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