fix(color): top bar widgets may not get removed when switching models (#5908)

This commit is contained in:
philmoz
2025-02-14 09:10:50 +10:00
committed by GitHub
parent 30c4784f46
commit 19cd55df37
2 changed files with 8 additions and 0 deletions
@@ -66,6 +66,8 @@ void LayoutFactory::deleteCustomScreens()
screen = nullptr;
}
}
ViewMain::instance()->getTopbar()->removeAllWidgets();
}
void LayoutFactory::loadDefaultLayout()
@@ -83,6 +83,12 @@ class WidgetsContainerImpl : public WidgetsContainer
virtual void create() { memset(persistentData, 0, sizeof(PersistentData)); }
void removeAllWidgets()
{
for (unsigned int i = 0; i < N; i++)
removeWidget(i);
}
virtual void load()
{
unsigned int count = getZonesCount();