mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-28 17:09:41 +00:00
Handle Element root changing type
This commit is contained in:
parent
919e067ab7
commit
4ba2aca3d3
1 changed files with 5 additions and 0 deletions
|
@ -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 a new issue