From 3a3d8bfbad4465f3ea6e883281438935e4adc563 Mon Sep 17 00:00:00 2001 From: Raphael Coeffic Date: Sun, 25 Apr 2021 14:01:33 +0200 Subject: [PATCH] Cleanup --- radio/src/gui/colorlcd/select_fab_button.cpp | 7 +------ radio/src/gui/colorlcd/view_main_menu.cpp | 9 +++------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/radio/src/gui/colorlcd/select_fab_button.cpp b/radio/src/gui/colorlcd/select_fab_button.cpp index 9e092a27d..3f8293782 100644 --- a/radio/src/gui/colorlcd/select_fab_button.cpp +++ b/radio/src/gui/colorlcd/select_fab_button.cpp @@ -34,10 +34,6 @@ SelectFabButton::SelectFabButton(FormGroup* parent, coord_t x, coord_t y, // 2 Lines extra for the text + half border setHeight(FAB_BUTTON_SIZE + 2 * PAGE_LINE_HEIGHT + SELECT_BUTTON_BORDER / 2); - - // if (height() < (width() / 2) * 3) { - // setHeight((width() / 2) * 3); - // } } void SelectFabButton::paint(BitmapBuffer* dc) @@ -45,13 +41,12 @@ void SelectFabButton::paint(BitmapBuffer* dc) FabButton::paint(dc); auto pos = title.find('\n'); - auto y_pos = FAB_BUTTON_SIZE;// + (height() - FAB_BUTTON_SIZE) / 5; + auto y_pos = FAB_BUTTON_SIZE; dc->drawSizedText(width() / 2, y_pos, title.c_str(), pos, FOCUS_COLOR | CENTERED | VCENTERED); if (pos != std::string::npos) { - // y_pos += (height() - FAB_BUTTON_SIZE) / 3; y_pos += PAGE_LINE_HEIGHT; dc->drawSizedText(width() / 2, y_pos, title.substr(pos+1).c_str(), 255, FOCUS_COLOR | CENTERED | VCENTERED); diff --git a/radio/src/gui/colorlcd/view_main_menu.cpp b/radio/src/gui/colorlcd/view_main_menu.cpp index 1677519b4..69cf99ed9 100644 --- a/radio/src/gui/colorlcd/view_main_menu.cpp +++ b/radio/src/gui/colorlcd/view_main_menu.cpp @@ -30,16 +30,13 @@ #include "view_statistics.h" #include "select_fab_carousel.h" -// TODO: -// -> make SelectFabCarousel() -// -> contains only the scrolling area -// -> ViewMainMenu takes fullscreen -// -> SelectFabCarousel() has ViewMainMenu() as parent - ViewMainMenu::ViewMainMenu(Window* parent) : Window(parent->getFullScreenWindow(), {}) { + // Save focus Layer::push(this); + + // Take over the screen setWidth(parent->width()); setHeight(parent->height());