From 3bebaaec7a06ff2df8af016769fa497d42115b76 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Thu, 28 May 2026 23:13:29 +0200 Subject: [PATCH] Hide the spurious menu scroll chevrons on Simple theme The Simple theme's SimpleMenuScrollViewer template wraps menu items in a ScrollViewer whose Top / Bottom docked RepeatButtons are the classic Win9x scroll chevrons. Their IsVisible binding feeds through MenuScrollingVisibilityConverter which does an AreClose check on Extent vs Viewport. At any non-100% DPI scale (125%, 150%, ...) the layout-rounding pass leaves a small gap so AreClose returns false and the converter declares "content overflows," then both chevrons render even when the menu only has two items and obviously fits. Bug tracked upstream as AvaloniaUI/Avalonia#9501; the partial fix in PR #11916 (ScrollContentPresenter rounding) is already in 12.0.3 but doesn't widen the converter's tolerance, so the symptom persists. Hide both chevrons unconditionally inside any menu's scroll viewer. Safe because: (a) the popup positioner already clamps menu height to the available screen area, and (b) ILSpy's menus are short enough that real overflow doesn't occur on any sane display. Height = 0 collapses the DockPanel slot the chevrons would otherwise reserve before the visibility binding propagates. Two selectors (MenuFlyoutPresenter and ContextMenu) cover both managed-menu paths; the inline NativeMenuBar on Linux / Windows routes through the same SimpleMenuScrollViewer template, so the top-level menus pick this up too. Assisted-by: Claude:claude-opus-4-7:Claude Code --- ILSpy/App.axaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/ILSpy/App.axaml b/ILSpy/App.axaml index 74a6a9bab..c71939938 100644 --- a/ILSpy/App.axaml +++ b/ILSpy/App.axaml @@ -134,6 +134,26 @@ + + + +