mirror of
https://github.com/opentx/opentx.git
synced 2025-07-27 02:05:16 +03:00
Horus : improve add widgets (#5189)
* Go automatically to widget setup after adding a widget * Cosmetics
This commit is contained in:
parent
5791645877
commit
8e04a6e2e4
1 changed files with 12 additions and 3 deletions
|
@ -35,6 +35,7 @@ Layout * currentScreen;
|
||||||
WidgetsContainerInterface * currentContainer;
|
WidgetsContainerInterface * currentContainer;
|
||||||
Widget * currentWidget;
|
Widget * currentWidget;
|
||||||
uint8_t currentZone;
|
uint8_t currentZone;
|
||||||
|
bool widgetNeedsSettings;
|
||||||
|
|
||||||
#define SCREENS_SETUP_2ND_COLUMN 200
|
#define SCREENS_SETUP_2ND_COLUMN 200
|
||||||
|
|
||||||
|
@ -267,6 +268,7 @@ bool menuWidgetChoice(event_t event)
|
||||||
if (previousWidget)
|
if (previousWidget)
|
||||||
delete previousWidget;
|
delete previousWidget;
|
||||||
currentContainer->createWidget(currentZone, *iterator);
|
currentContainer->createWidget(currentZone, *iterator);
|
||||||
|
widgetNeedsSettings = currentContainer->getWidget(currentZone)->getFactory()->getOptions();
|
||||||
storageDirty(EE_MODEL);
|
storageDirty(EE_MODEL);
|
||||||
}
|
}
|
||||||
popMenu();
|
popMenu();
|
||||||
|
@ -377,6 +379,13 @@ bool menuWidgetsSetup(event_t event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
if (widgetNeedsSettings) {
|
||||||
|
currentWidget = currentContainer->getWidget(menuVerticalPosition);
|
||||||
|
if (currentWidget) {
|
||||||
|
widgetNeedsSettings = false;
|
||||||
|
onZoneMenu(STR_WIDGET_SETTINGS);
|
||||||
|
}
|
||||||
|
}
|
||||||
lcdDrawRect(zone.x-padding, zone.y-padding, zone.w+2*padding, zone.h+2*padding, thickness, 0x3F, color);
|
lcdDrawRect(zone.x-padding, zone.y-padding, zone.w+2*padding, zone.h+2*padding, thickness, 0x3F, color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue