fix(color): top bar widgets may not be shown (#7174)

This commit is contained in:
philmoz
2026-03-15 12:57:00 +10:00
committed by GitHub
parent df981597c6
commit 639d65ac63
5 changed files with 14 additions and 7 deletions
+1 -1
View File
@@ -1575,7 +1575,7 @@ void edgeTxInit()
#endif // defined(GUI)
#if defined(COLORLCD)
LayoutFactory::deleteCustomScreens(true);
LayoutFactory::deleteCustomScreens();
LayoutFactory::loadCustomScreens();
#endif
+6 -3
View File
@@ -107,7 +107,7 @@ WidgetsContainer* LayoutFactory::loadLayout(
//
// Detaches and deletes all custom screens
//
void LayoutFactory::deleteCustomScreens(bool clearTopBar)
void LayoutFactory::deleteCustomScreens()
{
for (auto& screen : customScreens) {
if (screen) {
@@ -115,9 +115,12 @@ void LayoutFactory::deleteCustomScreens(bool clearTopBar)
screen = nullptr;
}
}
}
if (clearTopBar)
ViewMain::instance()->getTopbar()->removeAllWidgets();
// Clear top bar
void LayoutFactory::deleteTopBarWidgets()
{
ViewMain::instance()->getTopbar()->removeAllWidgets();
}
void LayoutFactory::loadDefaultLayout()
+3 -1
View File
@@ -176,7 +176,9 @@ class LayoutFactory
void initPersistentData(int screenNum, bool setDefault) const;
// delete all custom screens from memory
static void deleteCustomScreens(bool clearTopBar = false);
static void deleteCustomScreens();
// delete all top bar widgets from memory
static void deleteTopBarWidgets();
// intended for existing models
static void loadCustomScreens();
@@ -626,7 +626,8 @@ void ModelLabelsWindow::newModel()
snprintf(path, LEN_BUFFER, "%s/%s", TEMPLATES_PATH, folder.c_str());
// Read model template
LayoutFactory::deleteCustomScreens(true);
LayoutFactory::deleteCustomScreens();
LayoutFactory::deleteTopBarWidgets();
loadModel((name + YAML_EXT).c_str(), false, path);
storageFlushCurrentModel();
storageCheck(true);
+2 -1
View File
@@ -149,7 +149,8 @@ void applyDefaultTemplate()
#if defined(COLORLCD)
g_model.resetScreenData();
LayoutFactory::deleteCustomScreens(true);
LayoutFactory::deleteCustomScreens();
LayoutFactory::deleteTopBarWidgets();
LayoutFactory::loadDefaultLayout();
#endif