fix(docking): address final code quality issues in docking layout

This commit is contained in:
2026-03-28 22:57:54 +09:00
parent c52daf3914
commit 666528263b
3 changed files with 12 additions and 1 deletions

View File

@@ -40,6 +40,7 @@ public partial class DockGroup : DockContainer
_tabView.DragOver -= OnDragOver;
_tabView.Drop -= OnDrop;
_tabView.DragLeave -= OnDragLeave;
_tabView.TabCloseRequested -= OnTabCloseRequested;
}
_tabView = GetTemplateChild(PART_TAB_VIEW) as TabView;
@@ -51,6 +52,7 @@ public partial class DockGroup : DockContainer
_tabView.DragOver += OnDragOver;
_tabView.Drop += OnDrop;
_tabView.DragLeave += OnDragLeave;
_tabView.TabCloseRequested += OnTabCloseRequested;
}
UpdateTabs();
@@ -94,6 +96,14 @@ public partial class DockGroup : DockContainer
Root?.HideHighlight();
}
private void OnTabCloseRequested(TabView sender, TabViewTabCloseRequestedEventArgs args)
{
if (args.Tab.Tag is DockDocument doc)
{
RemoveChild(doc);
}
}
protected override void OnChildrenUpdated()
{
UpdateTabs();