fix(dock): improve accessibility of drop target overlay
This commit is contained in:
@@ -12,7 +12,7 @@ namespace Ghost.Editor.View.Controls;
|
|||||||
/// A control that renders a docking layout tree.
|
/// A control that renders a docking layout tree.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[TemplatePart(Name = PART_ROOT_GRID, Type = typeof(Grid))]
|
[TemplatePart(Name = PART_ROOT_GRID, Type = typeof(Grid))]
|
||||||
[TemplatePart(Name = PART_DROP_TARGET_OVERLAY, Type = typeof(Border))]
|
[TemplatePart(Name = PART_DROP_TARGET_OVERLAY, Type = typeof(FrameworkElement))]
|
||||||
public sealed partial class DockLayout : Control
|
public sealed partial class DockLayout : Control
|
||||||
{
|
{
|
||||||
private const string PART_ROOT_GRID = "PART_RootGrid";
|
private const string PART_ROOT_GRID = "PART_RootGrid";
|
||||||
@@ -20,7 +20,7 @@ public sealed partial class DockLayout : Control
|
|||||||
private const double MIN_PANE_SIZE = 100;
|
private const double MIN_PANE_SIZE = 100;
|
||||||
private const double SPLITTER_THICKNESS = 4;
|
private const double SPLITTER_THICKNESS = 4;
|
||||||
|
|
||||||
private Border? _dropTargetOverlay;
|
private FrameworkElement? _dropTargetOverlay;
|
||||||
private readonly HashSet<DockNode> _subscribedNodes = new();
|
private readonly HashSet<DockNode> _subscribedNodes = new();
|
||||||
|
|
||||||
internal enum DockPosition { Center, Top, Bottom, Left, Right, None }
|
internal enum DockPosition { Center, Top, Bottom, Left, Right, None }
|
||||||
@@ -292,7 +292,7 @@ public sealed partial class DockLayout : Control
|
|||||||
protected override void OnApplyTemplate()
|
protected override void OnApplyTemplate()
|
||||||
{
|
{
|
||||||
base.OnApplyTemplate();
|
base.OnApplyTemplate();
|
||||||
_dropTargetOverlay = GetTemplateChild(PART_DROP_TARGET_OVERLAY) as Border;
|
_dropTargetOverlay = GetTemplateChild(PART_DROP_TARGET_OVERLAY) as FrameworkElement;
|
||||||
RenderTree();
|
RenderTree();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,13 +9,10 @@
|
|||||||
<ControlTemplate TargetType="local:DockLayout">
|
<ControlTemplate TargetType="local:DockLayout">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid x:Name="PART_RootGrid" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" />
|
<Grid x:Name="PART_RootGrid" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" />
|
||||||
<Border x:Name="PART_DropTargetOverlay"
|
<Grid x:Name="PART_DropTargetOverlay" Visibility="Collapsed" IsHitTestVisible="False">
|
||||||
Background="{ThemeResource SystemControlHighlightAccentBrush}"
|
<Border Background="{ThemeResource SystemControlHighlightAccentBrush}" Opacity="0.4" />
|
||||||
Opacity="0.4"
|
<Border BorderBrush="{ThemeResource SystemControlHighlightAccentBrush}" BorderThickness="2" />
|
||||||
BorderBrush="{ThemeResource SystemControlHighlightAccentBrush}"
|
</Grid>
|
||||||
BorderThickness="2"
|
|
||||||
Visibility="Collapsed"
|
|
||||||
IsHitTestVisible="False" />
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Setter.Value>
|
</Setter.Value>
|
||||||
|
|||||||
Reference in New Issue
Block a user