diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index 885bffcee..7a4589ef1 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -1107,6 +1107,10 @@ void Screen::dismissCurrentFrame() LOG_DEBUG("Dismiss WiFi Screen"); dismissedFrames.wifi = true; dismissed = true; + } else if (currentFrame == framesetInfo.positions.lora) { + LOG_INFO("Dismiss LoRa"); + dismissedFrames.lora = true; + dismissed = true; } else if (currentFrame == framesetInfo.positions.system) { LOG_INFO("Dismiss Memory"); dismissedFrames.system = true; @@ -1416,7 +1420,7 @@ int Screen::handleInputEvent(const InputEvent *event) } else if (this->ui->getUiState()->currentFrame == framesetInfo.positions.clock) { menuHandler::clockMenu(); } else if (this->ui->getUiState()->currentFrame == framesetInfo.positions.lora) { - menuHandler::LoraRegionPicker(); + menuHandler::loraMenu(); } else if (this->ui->getUiState()->currentFrame == framesetInfo.positions.textMessage) { if (devicestate.rx_text_message.from) { menuHandler::messageResponseMenu(); diff --git a/src/graphics/draw/MenuHandler.cpp b/src/graphics/draw/MenuHandler.cpp index 884f7be1d..b16e12ab1 100644 --- a/src/graphics/draw/MenuHandler.cpp +++ b/src/graphics/draw/MenuHandler.cpp @@ -23,6 +23,25 @@ menuHandler::screenMenus menuHandler::menuQueue = menu_none; bool test_enabled = false; uint8_t test_count = 0; +void menuHandler::loraMenu() +{ + static const char *optionsArray[] = {"Back", "Region Picker", "Dismiss Frame"}; + enum optionsNumbers { Back = 0, lora_picker = 1, DismissCurrentFrame = 2 }; + BannerOverlayOptions bannerOptions; + bannerOptions.message = "LoRa Actions"; + bannerOptions.optionsArrayPtr = optionsArray; + bannerOptions.optionsCount = 3; + bannerOptions.bannerCallback = [](int selected) -> void { + if (selected == Back) { + menuHandler::menuQueue = menuHandler::clock_menu; + screen->runNow(); + } else if (selected == DismissCurrentFrame) { + menuHandler::menuQueue = menuHandler::DismissCurrentFrame; + } + }; + screen->showOverlayBanner(bannerOptions); +} + void menuHandler::LoraRegionPicker(uint32_t duration) { static const char *optionsArray[] = {"Back", diff --git a/src/graphics/draw/MenuHandler.h b/src/graphics/draw/MenuHandler.h index 2bf723b18..b40d0b1cf 100644 --- a/src/graphics/draw/MenuHandler.h +++ b/src/graphics/draw/MenuHandler.h @@ -42,6 +42,7 @@ class menuHandler static screenMenus menuQueue; static void LoraRegionPicker(uint32_t duration = 30000); + static void loraMenu(); static void handleMenuSwitch(OLEDDisplay *display); static void clockMenu(); static void TZPicker();