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

PXX2 refactoring + Popups refactoring

This commit is contained in:
Bertrand Songis 2019-03-26 13:11:32 +01:00
parent bdd9017589
commit db316af98d
19 changed files with 184 additions and 75 deletions

View file

@ -400,8 +400,6 @@ void handleGui(event_t event) {
}
}
bool inPopupMenu = false;
void guiMain(event_t evt)
{
#if defined(LUA)
@ -446,22 +444,14 @@ void guiMain(event_t evt)
else if (popupMenuItemsCount > 0) {
// popup menu is active display it on top of normal menus
handleGui(0); // suppress events, they are handled by the popup
if (!inPopupMenu) {
TRACE("Popup Menu started");
inPopupMenu = true;
}
const char * result = runPopupMenu(evt);
if (popupMenuItemsCount == 0) {
if (result) {
TRACE("popupMenuHandler(%s)", result);
popupMenuHandler(result);
}
}
else {
// normal menus
if (inPopupMenu) {
TRACE("Popup Menu ended");
inPopupMenu = false;
}
handleGui(evt);
}