diff --git a/radio/sdcard/horus/THEMES/TBS/main.lua b/radio/sdcard/horus/THEMES/TBS/main.lua index 56e06e46f..3defe5d3c 100644 --- a/radio/sdcard/horus/THEMES/TBS/main.lua +++ b/radio/sdcard/horus/THEMES/TBS/main.lua @@ -1,3 +1,5 @@ +local bitmap = 0 + local function load() lcd.setColor(TEXT_COLOR_INDEX, WHITE) lcd.setColor(TEXT_BGCOLOR_INDEX, BLACK) @@ -24,11 +26,14 @@ local function load() lcd.setColor(HEADER_ICON_BGCOLOR_INDEX, BLACK) lcd.setColor(HEADER_CURRENT_BGCOLOR_INDEX, lcd.RGB(10, 78, 121)) lcd.setColor(OVERLAY_COLOR_INDEX, BLACK) + bitmap = lcd.loadBitmap("THEMES/TBS/thumb.bmp") return 0 end local function drawBackground() lcd.drawFilledRectangle(0, 0, LCD_W, LCD_H, TEXT_BGCOLOR); + + lcd.drawBitmap(50, 50, bitmap) end local function drawTopbarBackground(icon) diff --git a/radio/src/gui/horus/navigation.cpp b/radio/src/gui/horus/navigation.cpp index 6bd62ff41..34ba5ab2d 100644 --- a/radio/src/gui/horus/navigation.cpp +++ b/radio/src/gui/horus/navigation.cpp @@ -323,7 +323,8 @@ int checkIncDec(evt_t event, int val, int i_min, int i_max, unsigned int i_flags } #define CURSOR_NOT_ALLOWED_IN_ROW(row) ((int8_t)MAXCOL(row) < 0) -#define MAXCOL_RAW(row) ((row) >= 0 && horTab ? pgm_read_byte(horTab+min(row, (int)horTabMax)) : (const uint8_t)0) +#define HORTAB(row) (int8_t(row) > (int8_t)horTabMax ? horTab[horTabMax] : horTab[row]) +#define MAXCOL_RAW(row) (horTab ? HORTAB(row) : (const uint8_t)0) #define MAXCOL(row) (MAXCOL_RAW(row) >= HIDDEN_ROW ? MAXCOL_RAW(row) : (const uint8_t)(MAXCOL_RAW(row) & (~NAVIGATION_LINE_BY_LINE))) #define COLATTR(row) (MAXCOL_RAW(row) == (uint8_t)-1 ? (const uint8_t)0 : (const uint8_t)(MAXCOL_RAW(row) & NAVIGATION_LINE_BY_LINE)) #define INC(val, min, max) if (valmin) {val=min;} @@ -542,7 +543,7 @@ bool check(check_event_t event, uint8_t curr, const MenuHandlerFunc * menuTab, u if (horTab) { linesCount = 0; for (int i=0; ihorTabMax || horTab[i] != HIDDEN_ROW) { + if (HORTAB(i) != HIDDEN_ROW) { linesCount++; } } @@ -553,7 +554,7 @@ bool check(check_event_t event, uint8_t curr, const MenuHandlerFunc * menuTab, u while (1) { int firstLine = 0; for (int numLines=0; firstLine=horTabMax || horTab[firstLine] != HIDDEN_ROW) { + if (HORTAB(firstLine) != HIDDEN_ROW) { numLines++; } } @@ -563,17 +564,17 @@ bool check(check_event_t event, uint8_t curr, const MenuHandlerFunc * menuTab, u else { int lastLine = firstLine; for (int numLines=0; lastLine= horTabMax || horTab[lastLine] != HIDDEN_ROW) { + if (HORTAB(lastLine) != HIDDEN_ROW) { numLines++; } } - if (menuVerticalPosition >= lastLine || ((firstLine <= horTabMax) && (horTab[firstLine] == ORPHAN_ROW))) { + if (menuVerticalPosition >= lastLine || HORTAB(firstLine) == ORPHAN_ROW) { menuVerticalOffset++; } else { linesCount = menuVerticalOffset + linesDisplayed; for (int i=lastLine; i horTabMax || horTab[i] != HIDDEN_ROW) { + if (HORTAB(i) != HIDDEN_ROW) { linesCount++; } }