perf(color): Remove multiple checks for model notes in quick menu (#4382)

This commit is contained in:
philmoz
2023-12-06 09:24:40 +10:00
committed by GitHub
parent cc17046e7a
commit cea924a400
+4 -2
View File
@@ -47,8 +47,10 @@ ViewMainMenu::ViewMainMenu(Window* parent, std::function<void()> 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<void()> closeHandler) :
return 0;
});
if (modelHasNotes()) {
if (hasNotes) {
carousel->addButton(ICON_MODEL_NOTES, STR_MAIN_MENU_MODEL_NOTES,
[=]() -> uint8_t {
deleteLater();