1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-17 13:25:20 +03:00

Properly space swich/pots check text

This commit is contained in:
3djc 2021-01-14 16:58:10 +01:00
parent 0ee0c83d6f
commit 6ffed2c777

View file

@ -663,6 +663,9 @@ void checkSwitches()
} }
int x = SWITCH_WARNING_LIST_X; int x = SWITCH_WARNING_LIST_X;
int y = SWITCH_WARNING_LIST_Y; int y = SWITCH_WARNING_LIST_Y;
#if defined(COLORLCD)
lcdNextPos = SWITCH_WARNING_LIST_X;
#endif
int numWarnings = 0; int numWarnings = 0;
for (int i=0; i<NUM_SWITCHES; ++i) { for (int i=0; i<NUM_SWITCHES; ++i) {
#if defined(COLORLCD) #if defined(COLORLCD)
@ -672,8 +675,7 @@ void checkSwitches()
if (++numWarnings < 6) { if (++numWarnings < 6) {
// LcdFlags attr = ((states & mask) == (switches_states & mask)) ? TEXT_COLOR : ALARM_COLOR; // LcdFlags attr = ((states & mask) == (switches_states & mask)) ? TEXT_COLOR : ALARM_COLOR;
LcdFlags attr = ALARM_COLOR; LcdFlags attr = ALARM_COLOR;
drawSwitch(x, y, SWSRC_FIRST_SWITCH+i*3+state-1, attr); drawSwitch(lcdNextPos, y, SWSRC_FIRST_SWITCH+i*3+state-1, attr);
x += 35;
} }
} }
} }
@ -706,8 +708,7 @@ void checkSwitches()
// TODO add an helper // TODO add an helper
strncpy(s, &STR_VSRCRAW[1+(NUM_STICKS+1+i)*STR_VSRCRAW[0]], STR_VSRCRAW[0]); strncpy(s, &STR_VSRCRAW[1+(NUM_STICKS+1+i)*STR_VSRCRAW[0]], STR_VSRCRAW[0]);
s[int(STR_VSRCRAW[0])] = '\0'; s[int(STR_VSRCRAW[0])] = '\0';
lcdDrawText(x, y, s, ALARM_COLOR); lcdDrawText(lcdNextPos, y, s, ALARM_COLOR);
x += 40;
#else #else
lcdDrawTextAtIndex(x, y, STR_VSRCRAW, NUM_STICKS + 1 + i, INVERS); lcdDrawTextAtIndex(x, y, STR_VSRCRAW, NUM_STICKS + 1 + i, INVERS);
if (IS_POT(POT1 + i)) if (IS_POT(POT1 + i))