Fix static initialization order problem with Horus GUI (#4141)

* [480x272] Fix static initialization order problem with Layout, Theme, & Widget factories.

* [480x272] Fix return from drawTimerMode().

* [480x272] Remove use of macros for registered Layout, Widget, & Theme class lists; remove extern declarations (cosmetic).

* [480x272] Convert Layout and Theme registry to dynamic lists (still max. of 10 each);
  Hide indicator arrow when user is at start/end of available widgets in spinner UI;
  Add some sanity checking to pointer usage in screens_setup;
  Add an (arbitrary) limit of 20 Widgets;
  And a line break! :)
This commit is contained in:
Max Paperno
2016-12-17 23:29:26 +01:00
committed by Bertrand Songis
parent d4d3d51a9d
commit bce42bb25c
8 changed files with 137 additions and 87 deletions
+6 -3
View File
@@ -279,10 +279,13 @@ void drawCurveName(coord_t x, coord_t y, int8_t idx, LcdFlags flags)
void drawTimerMode(coord_t x, coord_t y, int32_t mode, LcdFlags att)
{
if (mode >= 0) {
if (mode < TMRMODE_COUNT)
return lcdDrawTextAtIndex(x, y, STR_VTMRMODES, mode, att);
else
if (mode < TMRMODE_COUNT) {
lcdDrawTextAtIndex(x, y, STR_VTMRMODES, mode, att);
return;
}
else {
mode -= (TMRMODE_COUNT-1);
}
}
drawSwitch(x, y, mode, att);
}