Split number of topbar widgets for vertical and horizontal LCD. Add Exit button to topbar widgets setup.

This commit is contained in:
eshifri
2021-08-10 17:04:12 -07:00
parent 000b400b20
commit ff5e15cce7
2 changed files with 13 additions and 0 deletions
+9
View File
@@ -57,6 +57,15 @@ SetupTopBarWidgetsPage::SetupTopBarWidgetsPage(ScreenMenu* menu):
auto widget = new SetupWidgetsPageSlot(this, rect, topbar, i);
if (i == 0) widget->setFocus();
}
#if defined(HARDWARE_TOUCH)
new Button(
this, {0, 0, MENU_HEADER_BUTTON_WIDTH, MENU_HEADER_BUTTON_WIDTH},
[this]() -> uint8_t {
this->deleteLater();
return 1;
},
NO_FOCUS | FORM_NO_BORDER);
#endif
}
void SetupTopBarWidgetsPage::deleteLater(bool detach, bool trash)
@@ -29,7 +29,11 @@
#define WIDGET_NAME_LEN 10
#define MAX_WIDGET_OPTIONS 5 // Name?
#if LCD_W > LCD_H
#define MAX_TOPBAR_ZONES 4
#else
#define MAX_TOPBAR_ZONES 2
#endif
#define MAX_TOPBAR_OPTIONS 1 // just because of VC++ which doesn't like 0-size arrays :(
// Common 'ZoneOptionValue's among all layouts