From 53c91ce8a0bf1f8828dfc5122d4fae174a30e490 Mon Sep 17 00:00:00 2001 From: eshifri <46511024+eshifri@users.noreply.github.com> Date: Thu, 29 Sep 2022 19:26:07 -0700 Subject: [PATCH] fix(color): Restore "go to channel monitor" Button (#2390) * Restore go to channel monitor go_to_monitor_Button * Remove unnecessary parameter. --- radio/src/gui/colorlcd/menu_model.cpp | 11 +++++++++++ radio/src/gui/colorlcd/menu_model.h | 3 +++ 2 files changed, 14 insertions(+) diff --git a/radio/src/gui/colorlcd/menu_model.cpp b/radio/src/gui/colorlcd/menu_model.cpp index 6425c1e55..e76f42ad9 100644 --- a/radio/src/gui/colorlcd/menu_model.cpp +++ b/radio/src/gui/colorlcd/menu_model.cpp @@ -61,6 +61,7 @@ ModelMenu::ModelMenu(): #endif addTab(new ModelTelemetryPage()); + addGoToMonitorsButton(); } void ModelMenu::onEvent(event_t event) @@ -74,3 +75,13 @@ void ModelMenu::onEvent(event_t event) } #endif } + +void ModelMenu::addGoToMonitorsButton() +{ + OpenTxTheme::instance()->createTextButton( + &header, {LCD_W / 2 + 6, MENU_TITLE_TOP + 1, LCD_W / 2 - 8, MENU_TITLE_HEIGHT - 2}, + STR_OPEN_CHANNEL_MONITORS, [=]() { + pushEvent(EVT_KEY_FIRST(KEY_MODEL)); + return 0; + }); +} \ No newline at end of file diff --git a/radio/src/gui/colorlcd/menu_model.h b/radio/src/gui/colorlcd/menu_model.h index 34bf15fc1..57e85cfe0 100644 --- a/radio/src/gui/colorlcd/menu_model.h +++ b/radio/src/gui/colorlcd/menu_model.h @@ -34,6 +34,9 @@ class ModelMenu : public TabsGroup #if defined(DEBUG_WINDOWS) std::string getName() const override { return "ModelMenu"; } #endif + +protected: + void addGoToMonitorsButton(void); }; #endif // _MENU_MODEL_H_