mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-07 12:54:00 +00:00
Handle Element root changing type
This commit is contained in:
parent
919e067ab7
commit
4ba2aca3d3
@ -269,7 +269,12 @@ namespace LuaUi
|
||||
if (mRoot->widget()->getTypeName() != widgetType(layout()))
|
||||
{
|
||||
destroyRoot(mRoot);
|
||||
WidgetExtension* parent = mRoot->getParent();
|
||||
auto children = parent->children();
|
||||
auto it = std::find(children.begin(), children.end(), mRoot);
|
||||
mRoot = createWidget(layout(), 0);
|
||||
*it = mRoot;
|
||||
parent->setChildren(children);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user