From dcd684583d8d5fc09068ffae69a0db692f05cfdd Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Sat, 9 May 2026 12:12:40 +0200 Subject: [PATCH] Enlarge filter funnel hit area and make it click-actionable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- ILSpy/Metadata/MetadataColumnBuilder.cs | 27 ++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/ILSpy/Metadata/MetadataColumnBuilder.cs b/ILSpy/Metadata/MetadataColumnBuilder.cs index e0bdb4920..31ef871f9 100644 --- a/ILSpy/Metadata/MetadataColumnBuilder.cs +++ b/ILSpy/Metadata/MetadataColumnBuilder.cs @@ -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 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.