Theme: retemplate ContextMenu, brighter MenuItem hover
The white strip on the left of the context menu wasn't from MenuItem itself — it was the ContextMenu's default template that draws an icon column on the left of its popup chrome. Retemplating MenuItem alone left that column visible. Now the ContextMenu template is also reduced to a single Border + IsItemsHost StackPanel — no icon column at all. The MenuItem hover was barely visible (#2C2C32 vs Brush.Bg.Card #26262B). Now hover paints the row in Brush.Accent (#3B82F6 vivid blue) with white foreground — clearly readable. HasDropShadow=False on the ContextMenu removes the default drop shadow that was clashing with the WPF Aero-ish look. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -157,13 +157,30 @@
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- Style ContextMenu sombre, cohérent avec le thème -->
|
||||
<!-- Style ContextMenu sombre, cohérent avec le thème.
|
||||
On retemplatise complètement pour virer la "icon column" claire que WPF
|
||||
dessine par défaut sur le bord gauche du popup. -->
|
||||
<Style TargetType="ContextMenu">
|
||||
<Setter Property="Background" Value="{StaticResource Brush.Bg.Card}" />
|
||||
<Setter Property="BorderBrush" Value="{StaticResource Brush.Border}" />
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
<Setter Property="Foreground" Value="{StaticResource Brush.Text.Primary}" />
|
||||
<Setter Property="Padding" Value="4" />
|
||||
<Setter Property="HasDropShadow" Value="False" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ContextMenu">
|
||||
<Border Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
CornerRadius="4">
|
||||
<StackPanel IsItemsHost="True"
|
||||
KeyboardNavigation.DirectionalNavigation="Cycle" />
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- MenuItem dark : on retemplatise pour virer la "icon column" claire à gauche
|
||||
@@ -186,7 +203,8 @@
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsHighlighted" Value="True">
|
||||
<Setter TargetName="Bd" Property="Background" Value="#2C2C32" />
|
||||
<Setter TargetName="Bd" Property="Background" Value="{StaticResource Brush.Accent}" />
|
||||
<Setter Property="Foreground" Value="White" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter Property="Foreground" Value="{StaticResource Brush.Text.Secondary}" />
|
||||
|
||||
Reference in New Issue
Block a user