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
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);
+3 -6
View File
@@ -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());