Layouts properly removed & deleted on model change
This commit is contained in:
@@ -65,8 +65,7 @@ void deleteCustomScreens()
|
||||
{
|
||||
for (auto& screen : customScreens) {
|
||||
if (screen) {
|
||||
screen->detach();
|
||||
delete screen;
|
||||
screen->deleteLater();
|
||||
screen = nullptr;
|
||||
}
|
||||
}
|
||||
@@ -83,6 +82,13 @@ void loadDefaultLayout()
|
||||
|
||||
strcpy(screenData.LayoutId, defaultLayout->getId());
|
||||
screen = defaultLayout->create(&screenData.layoutData);
|
||||
//
|
||||
// TODO:
|
||||
// -> attach a few default widgets
|
||||
// - ModelBmp
|
||||
// - Timer
|
||||
// - ???
|
||||
//
|
||||
if (screen) {
|
||||
screen->attach(ViewMain::instance());
|
||||
}
|
||||
|
||||
@@ -394,7 +394,7 @@ void ScreenSetupPage::build(FormWindow * window)
|
||||
// optionsWindow->getParent()->adjustInnerHeight();
|
||||
}
|
||||
|
||||
void ScreenSetupPage::updateLayoutOptions()
|
||||
void ScreenSetupPage::updateLayoutOptions() // TODO
|
||||
{
|
||||
#if 0
|
||||
FormGridLayout grid;
|
||||
|
||||
@@ -417,10 +417,7 @@ void ViewMain::createTrims()
|
||||
VERTICAL_SLIDERS_HEIGHT
|
||||
};
|
||||
|
||||
//r.x = left() + HMARGIN + TRIM_SQUARE_SIZE; // DBG
|
||||
trims[TRIMS_LV] = new MainViewVerticalTrim(this, r, 1);
|
||||
|
||||
//r.x = right() - HMARGIN - TRIM_SQUARE_SIZE; // DBG
|
||||
trims[TRIMS_RV] = new MainViewVerticalTrim(this, r, 2);
|
||||
}
|
||||
|
||||
|
||||
@@ -90,6 +90,13 @@ class Widget : public FormField
|
||||
{
|
||||
}
|
||||
|
||||
#if defined(DEBUG_WINDOWS)
|
||||
std::string getName() const override
|
||||
{
|
||||
return "Widget";
|
||||
}
|
||||
#endif
|
||||
|
||||
protected:
|
||||
const WidgetFactory * factory;
|
||||
PersistentData * persistentData;
|
||||
|
||||
@@ -61,6 +61,10 @@ void preModelLoad()
|
||||
#endif
|
||||
|
||||
stopTrainer();
|
||||
|
||||
#if defined(COLORLCD)
|
||||
deleteCustomScreens();
|
||||
#endif
|
||||
}
|
||||
|
||||
void postRadioSettingsLoad()
|
||||
|
||||
Reference in New Issue
Block a user