diff --git a/ui/screen.cpp b/ui/screen.cpp index 11ea16d079..61a369b8bf 100644 --- a/ui/screen.cpp +++ b/ui/screen.cpp @@ -155,6 +155,12 @@ void ScreenManager::pop() { } } +void ScreenManager::RecreateAllViews() { + for (auto it = stack_.begin(); it != stack_.end(); ++it) { + it->screen->RecreateViews(); + } +} + void ScreenManager::finishDialog(const Screen *dialog, DialogResult result) { if (dialog != stack_.back().screen) { ELOG("Wrong dialog being finished!"); diff --git a/ui/screen.h b/ui/screen.h index 9b4adcf905..bd0e871acc 100644 --- a/ui/screen.h +++ b/ui/screen.h @@ -48,6 +48,8 @@ public: virtual void axis(const AxisInput &touch) {} virtual void sendMessage(const char *msg, const char *value) {} + virtual void RecreateViews() {} + ScreenManager *screenManager() { return screenManager_; } void setScreenManager(ScreenManager *sm) { screenManager_ = sm; } @@ -89,6 +91,9 @@ public: // Push a dialog box in front. Currently 1-level only. void push(Screen *screen, int layerFlags = 0); + // Recreate all views + void RecreateAllViews(); + // Pops the dialog away. void finishDialog(const Screen *dialog, DialogResult result = DR_OK); diff --git a/ui/ui_screen.h b/ui/ui_screen.h index e761afb33d..fee4d99f96 100644 --- a/ui/ui_screen.h +++ b/ui/ui_screen.h @@ -23,7 +23,7 @@ protected: virtual void CreateViews() = 0; virtual void DrawBackground(UIContext &dc) {} - void RecreateViews() { recreateViews_ = true; } + virtual void RecreateViews() { recreateViews_ = true; } UI::ViewGroup *root_;