[Horus] background function added to widgets

This commit is contained in:
Bertrand Songis
2016-05-18 18:49:06 +02:00
parent 1da69e4066
commit 633af68fa9
4 changed files with 46 additions and 6 deletions
+7 -2
View File
@@ -182,8 +182,13 @@ bool menuMainView(evt_t event)
break;
}
if (customScreens[g_eeGeneral.view]) {
customScreens[g_eeGeneral.view]->refresh();
for (uint8_t i=0; i<MAX_CUSTOM_SCREENS; i++) {
if (customScreens[i]) {
if (i == g_eeGeneral.view)
customScreens[i]->refresh();
else
customScreens[i]->background();
}
}
return true;
+5 -1
View File
@@ -90,7 +90,7 @@ class Widget
{
}
virtual void update() const
virtual void update() const
{
}
@@ -108,6 +108,10 @@ class Widget
virtual void refresh() = 0;
virtual void background()
{
}
protected:
const WidgetFactory * factory;
Zone zone;
+11
View File
@@ -131,6 +131,17 @@ class WidgetsContainer: public WidgetsContainerInterface
}
}
virtual void background()
{
if (widgets) {
for (int i=0; i<N; i++) {
if (widgets[i]) {
widgets[i]->background();
}
}
}
}
protected:
PersistentData * persistentData;
};