[ghost] Fix RTN behavior on Ghost config menus (#1261)
* Fix menu back behavior in the Ghost menu When backing out of a ghost sub-menu one level, don't close the module menu unless already in the root menu. * Fix formatting
This commit is contained in:
@@ -134,10 +134,24 @@ void RadioGhostModuleConfig::onEvent(event_t event)
|
|||||||
reusableBuffer.ghostMenu.menuAction = GHST_MENU_CTRL_CLOSE;
|
reusableBuffer.ghostMenu.menuAction = GHST_MENU_CTRL_CLOSE;
|
||||||
moduleState[EXTERNAL_MODULE].counter = GHST_MENU_CONTROL;
|
moduleState[EXTERNAL_MODULE].counter = GHST_MENU_CONTROL;
|
||||||
RTOS_WAIT_MS(10);
|
RTOS_WAIT_MS(10);
|
||||||
deleteLater();
|
Page::onEvent(event);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Page::onEvent(event);
|
}
|
||||||
|
|
||||||
|
void RadioGhostModuleConfig::checkEvents()
|
||||||
|
{
|
||||||
|
Page::checkEvents();
|
||||||
|
|
||||||
|
if (reusableBuffer.ghostMenu.menuStatus == GHST_MENU_STATUS_UNOPENED) { // Handles situation where module is plugged after tools start
|
||||||
|
reusableBuffer.ghostMenu.buttonAction = GHST_BTN_NONE;
|
||||||
|
reusableBuffer.ghostMenu.menuAction = GHST_MENU_CTRL_OPEN;
|
||||||
|
moduleState[EXTERNAL_MODULE].counter = GHST_MENU_CONTROL;
|
||||||
|
}
|
||||||
|
else if (reusableBuffer.ghostMenu.menuStatus == GHST_MENU_STATUS_CLOSING) {
|
||||||
|
RTOS_WAIT_MS(10);
|
||||||
|
deleteLater();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ class RadioGhostModuleConfig: public Page
|
|||||||
|
|
||||||
#if defined(HARDWARE_KEYS)
|
#if defined(HARDWARE_KEYS)
|
||||||
void onEvent(event_t event) override;
|
void onEvent(event_t event) override;
|
||||||
|
void checkEvents();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
Reference in New Issue
Block a user