From cea924a400d29e135e4abe8f16be98e6f241c542 Mon Sep 17 00:00:00 2001 From: philmoz Date: Wed, 6 Dec 2023 10:24:40 +1100 Subject: [PATCH] perf(color): Remove multiple checks for model notes in quick menu (#4382) --- radio/src/gui/colorlcd/view_main_menu.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/radio/src/gui/colorlcd/view_main_menu.cpp b/radio/src/gui/colorlcd/view_main_menu.cpp index 331cde9fa..8adf20d80 100644 --- a/radio/src/gui/colorlcd/view_main_menu.cpp +++ b/radio/src/gui/colorlcd/view_main_menu.cpp @@ -47,8 +47,10 @@ ViewMainMenu::ViewMainMenu(Window* parent, std::function closeHandler) : Layer::push(this); coord_t width = VM_W; + bool hasNotes = modelHasNotes(); + #if LCD_W > LCD_H - if (modelHasNotes()) + if (hasNotes) width += FAB_BUTTON_SIZE; #endif @@ -65,7 +67,7 @@ ViewMainMenu::ViewMainMenu(Window* parent, std::function closeHandler) : return 0; }); - if (modelHasNotes()) { + if (hasNotes) { carousel->addButton(ICON_MODEL_NOTES, STR_MAIN_MENU_MODEL_NOTES, [=]() -> uint8_t { deleteLater();