Remove widgets from the layout as a FormGroup as well
and fix the focus order pointers. Resolves #257 and potentially more.
This commit is contained in:
@@ -123,8 +123,6 @@ void loadCustomScreens()
|
||||
}
|
||||
|
||||
auto topbar = viewMain->getTopbar();
|
||||
|
||||
// TODO: how to reload this guy?
|
||||
topbar->load();
|
||||
|
||||
viewMain->setCurrentMainView(0);
|
||||
|
||||
@@ -43,10 +43,12 @@ class WidgetsContainerImpl: public WidgetsContainer
|
||||
// remove old one if existing
|
||||
removeWidget(index);
|
||||
|
||||
Widget * widget = nullptr;
|
||||
Widget* widget = nullptr;
|
||||
if (factory) {
|
||||
strncpy(persistentData->zones[index].widgetName, factory->getName(), sizeof(ZonePersistentData::widgetName));
|
||||
widget = factory->create(this, getZone(index), &persistentData->zones[index].widgetData);
|
||||
strncpy(persistentData->zones[index].widgetName, factory->getName(),
|
||||
sizeof(ZonePersistentData::widgetName));
|
||||
widget = factory->create(this, getZone(index),
|
||||
&persistentData->zones[index].widgetData);
|
||||
}
|
||||
widgets[index] = widget;
|
||||
|
||||
@@ -61,12 +63,16 @@ class WidgetsContainerImpl: public WidgetsContainer
|
||||
if (index >= N)
|
||||
return;
|
||||
|
||||
if (widgets[index])
|
||||
if (widgets[index]) {
|
||||
removeField(widgets[index]);
|
||||
widgets[index]->deleteLater();
|
||||
}
|
||||
|
||||
widgets[index] = nullptr;
|
||||
memset(persistentData->zones[index].widgetName, 0, sizeof(ZonePersistentData::widgetName));
|
||||
memset(&persistentData->zones[index].widgetData, 0, sizeof(Widget::PersistentData));
|
||||
memset(persistentData->zones[index].widgetName, 0,
|
||||
sizeof(ZonePersistentData::widgetName));
|
||||
memset(&persistentData->zones[index].widgetData, 0,
|
||||
sizeof(Widget::PersistentData));
|
||||
}
|
||||
|
||||
Widget * getWidget(unsigned int index) override
|
||||
@@ -89,6 +95,7 @@ class WidgetsContainerImpl: public WidgetsContainer
|
||||
|
||||
// remove old widget
|
||||
if (widgets[i]) {
|
||||
removeField(widgets[i]);
|
||||
widgets[i]->deleteLater();
|
||||
widgets[i] = nullptr;
|
||||
}
|
||||
|
||||
Vendored
+1
-1
Submodule radio/src/thirdparty/libopenui updated: 6b661c4907...d1c94e6279
Reference in New Issue
Block a user