Browse Source

Enlarge filter funnel hit area and make it click-actionable

The 10x9 Path glyph was a fragile hover/click target. Wrap it in a transparent
Border with 8x4 padding so the hit area is comfortably bigger than the icon
itself, with the Path marked IsHitTestVisible=false so the Border owns hit
testing. Clicking the funnel opens the popup on flag columns or focuses the
TextBox on text columns — short-circuits the hover-then-click two-step.

Assisted-by: Claude:claude-opus-4-7:Claude Code
pull/3755/head
Siegfried Pammer 2 months ago
parent
commit
dcd684583d
  1. 27
      ILSpy/Metadata/MetadataColumnBuilder.cs

27
ILSpy/Metadata/MetadataColumnBuilder.cs

@ -141,8 +141,21 @@ namespace ILSpy.Metadata @@ -141,8 +141,21 @@ namespace ILSpy.Metadata
Stretch = Stretch.None,
Fill = Brushes.Gray,
Data = global::Avalonia.Media.Geometry.Parse("M0,0 L10,0 L6,4 L6,9 L4,9 L4,4 Z"),
Margin = new Thickness(4, 0, 0, 0),
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
IsHitTestVisible = false,
};
// Wrap the funnel in a transparent-background Border with generous padding so the
// hit area is comfortably larger than the 10×9 glyph itself; clicking the icon
// opens the popup (flags columns) or focuses the textbox (text columns) without
// having to wait for the hover-show.
var filterIconHost = new Border {
Background = Brushes.Transparent,
Padding = new Thickness(8, 4),
Child = filterIcon,
VerticalAlignment = VerticalAlignment.Stretch,
HorizontalAlignment = HorizontalAlignment.Right,
Cursor = new global::Avalonia.Input.Cursor(global::Avalonia.Input.StandardCursorType.Hand),
};
bool isFlagsColumn = propertyType.IsEnum
@ -167,10 +180,18 @@ namespace ILSpy.Metadata @@ -167,10 +180,18 @@ namespace ILSpy.Metadata
swap.Children.Add(inputRow);
var headerRow = new DockPanel { LastChildFill = true };
DockPanel.SetDock(filterIcon, global::Avalonia.Controls.Dock.Right);
headerRow.Children.Add(filterIcon);
DockPanel.SetDock(filterIconHost, global::Avalonia.Controls.Dock.Right);
headerRow.Children.Add(filterIconHost);
headerRow.Children.Add(swap);
filterIconHost.PointerPressed += (_, e) => {
if (popup != null)
popup.IsOpen = true;
else if (inputRow is TextBox tb)
tb.Focus();
e.Handled = true;
};
// The popup needs to live inside the visual tree but doesn't contribute layout.
// Park it in a Panel sibling so the header row's height stays driven solely by
// label / input.

Loading…
Cancel
Save