fix(docking): address code quality issues in Docking system
This commit is contained in:
@@ -53,14 +53,7 @@ public abstract class DockContainer : DockModule
|
||||
if (_children.Contains(module))
|
||||
return;
|
||||
|
||||
if (module.Owner == this)
|
||||
{
|
||||
RemoveChildInternal(module, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
module.Owner?.RemoveChild(module);
|
||||
}
|
||||
module.Owner?.RemoveChild(module);
|
||||
|
||||
module.Owner = this;
|
||||
module.Root = Root;
|
||||
|
||||
@@ -63,6 +63,7 @@ public class DockPanel : DockContainer
|
||||
{
|
||||
if (child is DockPanel childPanel)
|
||||
{
|
||||
RemoveChildInternal(childPanel, false);
|
||||
Root.RootPanel = childPanel;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,6 +59,11 @@ public class DockingLayout : Control
|
||||
throw new InvalidOperationException("Panel is already owned by another DockingLayout");
|
||||
}
|
||||
|
||||
if (newPanel.Owner != null)
|
||||
{
|
||||
newPanel.Owner.RemoveChild(newPanel);
|
||||
}
|
||||
|
||||
newPanel.Root = layout;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user