Allow for progressive Topbar (dis-)appearance

This commit is contained in:
Raphael Coeffic
2021-04-18 07:58:28 +02:00
parent d7ca222edd
commit 256e53a016
2 changed files with 14 additions and 0 deletions
+13
View File
@@ -57,6 +57,19 @@ void TopBar::setVisible(float visible) // 0.0 -> 1.0
}
}
coord_t TopBar::getVisibleHeight(float visible) const // 0.0 -> 1.0
{
if (visible == 0.0) {
return 0;
}
else if (visible == 1.0) {
return MENU_HEADER_HEIGHT;
}
float h = (float)MENU_HEADER_HEIGHT * visible;
return (coord_t)h;
}
const char * const STR_MONTHS[] = TR_MONTHS;
void TopBar::paint(BitmapBuffer * dc)
+1
View File
@@ -46,6 +46,7 @@ class TopBar: public WidgetsContainer<MAX_TOPBAR_ZONES, MAX_TOPBAR_OPTIONS>
rect_t getZone(unsigned int index) const override;
void setVisible(float visible);
coord_t getVisibleHeight(float visible) const; // 0.0 -> 1.0
void paint(BitmapBuffer * dc) override;