This commit is contained in:
Raphael Coeffic
2021-05-06 12:55:59 +02:00
committed by Raphael Coeffic
parent 05115bc2da
commit 3a3d8bfbad
2 changed files with 4 additions and 12 deletions
+1 -6
View File
@@ -34,10 +34,6 @@ SelectFabButton::SelectFabButton(FormGroup* parent, coord_t x, coord_t y,
// 2 Lines extra for the text + half border // 2 Lines extra for the text + half border
setHeight(FAB_BUTTON_SIZE + 2 * PAGE_LINE_HEIGHT + SELECT_BUTTON_BORDER / 2); 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) void SelectFabButton::paint(BitmapBuffer* dc)
@@ -45,13 +41,12 @@ void SelectFabButton::paint(BitmapBuffer* dc)
FabButton::paint(dc); FabButton::paint(dc);
auto pos = title.find('\n'); 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, dc->drawSizedText(width() / 2, y_pos,
title.c_str(), pos, title.c_str(), pos,
FOCUS_COLOR | CENTERED | VCENTERED); FOCUS_COLOR | CENTERED | VCENTERED);
if (pos != std::string::npos) { if (pos != std::string::npos) {
// y_pos += (height() - FAB_BUTTON_SIZE) / 3;
y_pos += PAGE_LINE_HEIGHT; y_pos += PAGE_LINE_HEIGHT;
dc->drawSizedText(width() / 2, y_pos, title.substr(pos+1).c_str(), dc->drawSizedText(width() / 2, y_pos, title.substr(pos+1).c_str(),
255, FOCUS_COLOR | CENTERED | VCENTERED); 255, FOCUS_COLOR | CENTERED | VCENTERED);
+3 -6
View File
@@ -30,16 +30,13 @@
#include "view_statistics.h" #include "view_statistics.h"
#include "select_fab_carousel.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) : ViewMainMenu::ViewMainMenu(Window* parent) :
Window(parent->getFullScreenWindow(), {}) Window(parent->getFullScreenWindow(), {})
{ {
// Save focus
Layer::push(this); Layer::push(this);
// Take over the screen
setWidth(parent->width()); setWidth(parent->width());
setHeight(parent->height()); setHeight(parent->height());