mirror of
https://github.com/opentx/opentx.git
synced 2025-07-23 16:25:16 +03:00
Make lcd.drawScreenTitle and lcd.drawCombobox compatible with X7 (#4374)
This commit is contained in:
parent
8775550147
commit
0c550588bb
2 changed files with 11 additions and 7 deletions
|
@ -2,7 +2,7 @@
|
|||
* Copyright (C) OpenTX
|
||||
*
|
||||
* Based on code named
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
|
@ -236,7 +236,7 @@ void lcdDrawHorizontalLine(coord_t x, coord_t y, coord_t w, uint8_t pat, LcdFlag
|
|||
void lcdDrawLine(coord_t x1, coord_t y1, coord_t x2, coord_t y2, uint8_t pat=SOLID, LcdFlags att=0);
|
||||
#endif
|
||||
|
||||
void lcdDrawFilledRect(coord_t x, scoord_t y, coord_t w, coord_t h, uint8_t pat, LcdFlags att=0);
|
||||
void lcdDrawFilledRect(coord_t x, scoord_t y, coord_t w, coord_t h, uint8_t pat=SOLID, LcdFlags att=0);
|
||||
inline void lcdDrawSolidFilledRect(coord_t x, scoord_t y, coord_t w, coord_t h, LcdFlags att=0)
|
||||
{
|
||||
lcdDrawFilledRect(x, y, w, h, SOLID, att);
|
||||
|
@ -272,7 +272,7 @@ inline display_t getPixel(uint8_t x, uint8_t y)
|
|||
if (x>=LCD_W || y>=LCD_H) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
display_t pixel = displayBuf[(y / 8) * LCD_W + x];
|
||||
display_t mask = 1 << (y & 7);
|
||||
return ((pixel & mask) ? 0xf : 0);
|
||||
|
|
|
@ -571,7 +571,7 @@ static int luaLcdDrawGauge(lua_State *L)
|
|||
}
|
||||
|
||||
|
||||
#if LCD_DEPTH > 1 && !defined(COLORLCD)
|
||||
#if !defined(COLORLCD)
|
||||
/*luadoc
|
||||
@function lcd.drawScreenTitle(title, page, pages)
|
||||
|
||||
|
@ -584,7 +584,7 @@ Draw a title bar
|
|||
@param pages (number) total number of pages. Only used as indicator on
|
||||
the right side of title bar. (i.e. idx=2, cnt=5, display `2/5`)
|
||||
|
||||
@notice Only available on Taranis X9 series
|
||||
@notice Only available on Taranis
|
||||
|
||||
@status current Introduced in 2.0.0
|
||||
*/
|
||||
|
@ -596,14 +596,16 @@ static int luaLcdDrawScreenTitle(lua_State *L)
|
|||
int cnt = luaL_checkinteger(L, 3);
|
||||
|
||||
if (cnt) drawScreenIndex(idx-1, cnt, 0);
|
||||
#if LCD_DEPTH > 1
|
||||
lcdDrawFilledRect(0, 0, LCD_W, FH, SOLID, FILL_WHITE|GREY_DEFAULT);
|
||||
#endif
|
||||
title(str);
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LCD_DEPTH > 1 && !defined(COLORLCD)
|
||||
#if !defined(COLORLCD)
|
||||
/*luadoc
|
||||
@function lcd.drawCombobox(x, y, w, list, idx [, flags])
|
||||
|
||||
|
@ -624,7 +626,7 @@ Draw a combo box
|
|||
* `INVERS` combo box collapsed, text inversed
|
||||
* `0 or not present` combo box collapsed, text normal
|
||||
|
||||
@notice Only available on Taranis X9 series
|
||||
@notice Only available on Taranis
|
||||
|
||||
@status current Introduced in 2.0.0
|
||||
*/
|
||||
|
@ -787,7 +789,9 @@ const luaL_Reg lcdLib[] = {
|
|||
{ "drawScreenTitle", luaLcdDrawScreenTitle },
|
||||
{ "drawCombobox", luaLcdDrawCombobox },
|
||||
#else
|
||||
{ "drawScreenTitle", luaLcdDrawScreenTitle },
|
||||
{ "getLastPos", luaLcdGetLastPos },
|
||||
{ "drawCombobox", luaLcdDrawCombobox },
|
||||
#endif
|
||||
{ NULL, NULL } /* sentinel */
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue