Let the TopBar follow the scrolling

This commit is contained in:
Raphael Coeffic
2021-04-18 07:57:42 +02:00
parent f98d4c65d1
commit ba3c879f75
2 changed files with 16 additions and 1 deletions
+12
View File
@@ -138,6 +138,18 @@ void ViewMain::previousMainView()
setCurrentMainView(view); setCurrentMainView(view);
} }
void ViewMain::setScrollPositionX(coord_t value)
{
Window::setScrollPositionX(value);
topbar->setLeft(getScrollPositionX());
}
void ViewMain::setScrollPositionY(coord_t value)
{
Window::setScrollPositionY(value);
topbar->setTop(getScrollPositionY());
}
#if defined(HARDWARE_KEYS) #if defined(HARDWARE_KEYS)
void ViewMain::onEvent(event_t event) void ViewMain::onEvent(event_t event)
{ {
+3
View File
@@ -75,6 +75,9 @@ class ViewMain: public Window
void nextMainView(); void nextMainView();
void previousMainView(); void previousMainView();
void setScrollPositionX(coord_t value) override;
void setScrollPositionY(coord_t value) override;
#if defined(HARDWARE_KEYS) #if defined(HARDWARE_KEYS)
void onEvent(event_t event) override; void onEvent(event_t event) override;
#endif #endif