From 6f54e8d2d3bfe81bfa5bdaad639ee463dfc09b0f Mon Sep 17 00:00:00 2001 From: philmoz Date: Mon, 20 Nov 2023 09:07:53 +1100 Subject: [PATCH] fix(color): Incorrect scroll position on quick menu if model has notes (#4335) --- radio/src/gui/colorlcd/view_main_menu.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/radio/src/gui/colorlcd/view_main_menu.cpp b/radio/src/gui/colorlcd/view_main_menu.cpp index 36bb4f3bc..331cde9fa 100644 --- a/radio/src/gui/colorlcd/view_main_menu.cpp +++ b/radio/src/gui/colorlcd/view_main_menu.cpp @@ -46,8 +46,14 @@ ViewMainMenu::ViewMainMenu(Window* parent, std::function closeHandler) : // Save focus Layer::push(this); + coord_t width = VM_W; +#if LCD_W > LCD_H + if (modelHasNotes()) + width += FAB_BUTTON_SIZE; +#endif + auto box = - new Window(this, {(LCD_W - VM_W) / 2, (LCD_H - VM_H) / 2, VM_W, VM_H}, 0, + new Window(this, {(LCD_W - width) / 2, (LCD_H - VM_H) / 2, width, VM_H}, 0, 0, etx_modal_dialog_create); box->padAll(8); @@ -120,8 +126,6 @@ ViewMainMenu::ViewMainMenu(Window* parent, std::function closeHandler) : new AboutUs(); return 0; }); - - lv_obj_center(carousel->getLvObj()); } void ViewMainMenu::deleteLater(bool detach, bool trash)