mirror of
https://github.com/EdgeTX/edgetx.git
synced 2025-07-25 17:25:10 +03:00
PXX2 refactoring + Popups refactoring
This commit is contained in:
parent
bdd9017589
commit
db316af98d
19 changed files with 184 additions and 75 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue