Fix display of more the 7 tools in BW screens (#7270)

This commit is contained in:
3djc
2020-01-06 09:09:00 +01:00
committed by Bertrand Songis
parent dc3e9b4153
commit 39788e1a78
+6 -1
View File
@@ -25,9 +25,12 @@ extern uint8_t g_moduleIdx;
bool addRadioTool(uint8_t index, const char * label) bool addRadioTool(uint8_t index, const char * label)
{ {
if (index >= menuVerticalOffset) {
uint8_t lineIndex = index - menuVerticalOffset;
if (lineIndex < NUM_BODY_LINES) {
int8_t sub = menuVerticalPosition - HEADER_LINE; int8_t sub = menuVerticalPosition - HEADER_LINE;
LcdFlags attr = (sub == index ? INVERS : 0); LcdFlags attr = (sub == index ? INVERS : 0);
coord_t y = MENU_HEADER_HEIGHT + 1 + index * FH; coord_t y = MENU_HEADER_HEIGHT + lineIndex * FH;
lcdDrawNumber(3, y, index + 1, LEADING0 | LEFT, 2); lcdDrawNumber(3, y, index + 1, LEADING0 | LEFT, 2);
lcdDrawText(3 * FW, y, label, (sub == index ? INVERS : 0)); lcdDrawText(3 * FW, y, label, (sub == index ? INVERS : 0));
if (attr && s_editMode > 0) { if (attr && s_editMode > 0) {
@@ -35,6 +38,8 @@ bool addRadioTool(uint8_t index, const char * label)
killAllEvents(); killAllEvents();
return true; return true;
} }
}
}
return false; return false;
} }