Browse Source

Give menu dropdown rows WPF-like height with centred content

The Simple theme sizes a menu row to its 16px icon plus margins (~24px), tighter
than the classic WPF menu. Raise MinHeight so the rows have comparable vertical
breathing room, and centre the icon, label and input-gesture text in the taller
row (the theme template leaves their VerticalAlignment unset, so a style reaches
them) instead of letting them sit at the top.

Assisted-by: Claude:claude-opus-4-8:Claude Code
pull/3818/head
Siegfried Pammer 2 weeks ago committed by Siegfried Pammer
parent
commit
36b0c94dd7
  1. 13
      ILSpy/App.axaml

13
ILSpy/App.axaml

@ -255,6 +255,19 @@ @@ -255,6 +255,19 @@
<Style Selector="MenuItem">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Foreground" Value="{DynamicResource ILSpy.MenuForeground}" />
<!-- The Simple theme sizes a dropdown row to its 16px icon plus margins (~24px), tighter
than the classic WPF menu. Give rows more vertical breathing room to match. -->
<Setter Property="MinHeight" Value="28" />
</Style>
<!-- Centre the icon and label in the taller row instead of letting them sit at the top. -->
<Style Selector="MenuItem /template/ ContentPresenter#PART_IconPresenter">
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<Style Selector="MenuItem /template/ ContentPresenter#PART_HeaderPresenter">
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<Style Selector="MenuItem /template/ TextBlock#PART_InputGestureText">
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<Style Selector="ContextMenu">
<Setter Property="Background" Value="{DynamicResource ILSpy.MenuBackground}" />

Loading…
Cancel
Save