From 49e6bbe8b088da9c1defc8d5ae3eb8278205a951 Mon Sep 17 00:00:00 2001 From: Misaki Date: Sat, 28 Mar 2026 13:32:29 +0900 Subject: [PATCH] feat(dock): add visual drop target overlay --- src/Editor/Ghost.Editor/View/Controls/DockLayout.cs | 5 +++++ src/Editor/Ghost.Editor/View/Controls/DockLayout.xaml | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/Editor/Ghost.Editor/View/Controls/DockLayout.cs b/src/Editor/Ghost.Editor/View/Controls/DockLayout.cs index b247394..60e6848 100644 --- a/src/Editor/Ghost.Editor/View/Controls/DockLayout.cs +++ b/src/Editor/Ghost.Editor/View/Controls/DockLayout.cs @@ -15,11 +15,15 @@ namespace Ghost.Editor.View.Controls; public sealed partial class DockLayout : Control { private const string PART_ROOT_GRID = "PART_RootGrid"; + private const string PART_DROP_TARGET_OVERLAY = "PART_DropTargetOverlay"; private const double MIN_PANE_SIZE = 100; private const double SPLITTER_THICKNESS = 4; + private Border? _dropTargetOverlay; private readonly HashSet _subscribedNodes = new(); + public enum DockPosition { Center, Top, Bottom, Left, Right, None } + public DockLayout() { DefaultStyleKey = typeof(DockLayout); @@ -287,6 +291,7 @@ public sealed partial class DockLayout : Control protected override void OnApplyTemplate() { base.OnApplyTemplate(); + _dropTargetOverlay = GetTemplateChild(PART_DROP_TARGET_OVERLAY) as Border; RenderTree(); } } diff --git a/src/Editor/Ghost.Editor/View/Controls/DockLayout.xaml b/src/Editor/Ghost.Editor/View/Controls/DockLayout.xaml index 5e97212..c67f56c 100644 --- a/src/Editor/Ghost.Editor/View/Controls/DockLayout.xaml +++ b/src/Editor/Ghost.Editor/View/Controls/DockLayout.xaml @@ -7,7 +7,15 @@ - + + + +