Skip to content

Commit

Permalink
Added ContextMenu styles (#284)
Browse files Browse the repository at this point in the history
  • Loading branch information
lpeyr committed Jul 8, 2023
1 parent 01d2d92 commit 2bc847b
Showing 1 changed file with 52 additions and 10 deletions.
62 changes: 52 additions & 10 deletions ColorPicker/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -1035,17 +1035,17 @@
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="FocusVisual1">
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Rectangle Margin="2" StrokeDashArray="1 2" SnapsToDevicePixels="true" StrokeThickness="1" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="FocusVisual1">
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Rectangle Margin="2" StrokeDashArray="1 2" SnapsToDevicePixels="true" StrokeThickness="1" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

<SolidColorBrush x:Key="OptionMark.Static.Background" Color="#FFFFFFFF"/>
<SolidColorBrush x:Key="OptionMark.Static.Background" Color="#FFFFFFFF"/>
<SolidColorBrush x:Key="OptionMark.Static.Border" Color="#FF707070"/>
<SolidColorBrush x:Key="OptionMark.Static.Glyph" Color="White"/>
<SolidColorBrush x:Key="OptionMark.MouseOver.Background" Color="Transparent"/>
Expand Down Expand Up @@ -1117,6 +1117,48 @@
</Setter.Value>
</Setter>
</Style>
<Style TargetType="MenuItem" x:Key="MenuStyle">
<Setter Property="BorderThickness" Value="0" />
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="Foreground" Value="{Binding Source={StaticResource Background1}}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="MenuItem">
<Border x:Name="Border" Padding="2" MinWidth="100" CornerRadius="5" Background="{TemplateBinding Background}">
<ContentPresenter ContentSource="Header" Margin="2" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Border" Property="Background" Value="{Binding Source={StaticResource Background2}}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

<Style TargetType="ContextMenu" x:Key="ContextMenuStyle">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Border Padding="5" CornerRadius="5" Margin="10" Background="{Binding Source={StaticResource Background1}}">
<ScrollViewer
Style="{DynamicResource {ComponentResourceKey ResourceId=MenuScrollViewer, TypeInTargetAssembly={x:Type FrameworkElement}}}"
Uid="ScrollViewer_9"
CanContentScroll="True">
<ItemsPresenter Margin="{TemplateBinding Padding}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
KeyboardNavigation.DirectionalNavigation="Cycle" />
</ScrollViewer>

<Border.Effect>
<DropShadowEffect BlurRadius="15" Color="#000" Direction="135" Opacity="0.2" ShadowDepth="0" />
</Border.Effect>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
</Application.Resources>
</Application>

0 comments on commit 2bc847b

Please sign in to comment.