mirror of https://github.com/icsharpcode/ILSpy.git
Browse Source
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 Codepull/3755/head
1 changed files with 20 additions and 0 deletions
Loading…
Reference in new issue