Add Context Menu Style & Template for darkmode

This commit is contained in:
DB p 2021-11-26 01:34:50 +09:00
parent ffa7e92b56
commit 1d6e18f2fd
4 changed files with 299 additions and 160 deletions

View file

@ -1,105 +1,193 @@
<Window x:Class="Flow.Launcher.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:flowlauncher="clr-namespace:Flow.Launcher"
xmlns:vm="clr-namespace:Flow.Launcher.ViewModel"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:converters="clr-namespace:Flow.Launcher.Converters"
xmlns:svgc="http://sharpvectors.codeplex.com/svgc/"
mc:Ignorable="d"
Title="Flow Launcher"
Topmost="True"
SizeToContent="Height"
ResizeMode="NoResize"
WindowStyle="None"
WindowStartupLocation="Manual"
AllowDrop="True"
ShowInTaskbar="False"
Style="{DynamicResource WindowStyle}"
Icon="Images/app.png"
AllowsTransparency="True"
Background="Transparent"
Loaded="OnLoaded"
Initialized="OnInitialized"
Closing="OnClosing"
LocationChanged="OnLocationChanged"
Deactivated="OnDeactivated"
PreviewKeyDown="OnKeyDown"
MinWidth="{Binding MainWindowWidth, Mode=OneWay}"
MaxWidth="{Binding MainWindowWidth, Mode=OneWay}"
Visibility="{Binding MainWindowVisibility, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
d:DataContext="{d:DesignInstance vm:MainViewModel}">
<Window
x:Class="Flow.Launcher.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="clr-namespace:Flow.Launcher.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:flowlauncher="clr-namespace:Flow.Launcher"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:svgc="http://sharpvectors.codeplex.com/svgc/"
xmlns:vm="clr-namespace:Flow.Launcher.ViewModel"
Title="Flow Launcher"
MinWidth="{Binding MainWindowWidth, Mode=OneWay}"
MaxWidth="{Binding MainWindowWidth, Mode=OneWay}"
d:DataContext="{d:DesignInstance vm:MainViewModel}"
AllowDrop="True"
AllowsTransparency="True"
Background="Transparent"
Closing="OnClosing"
Deactivated="OnDeactivated"
Icon="Images/app.png"
Initialized="OnInitialized"
Loaded="OnLoaded"
LocationChanged="OnLocationChanged"
PreviewKeyDown="OnKeyDown"
ResizeMode="NoResize"
ShowInTaskbar="False"
SizeToContent="Height"
Style="{DynamicResource WindowStyle}"
Topmost="True"
Visibility="{Binding MainWindowVisibility, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
WindowStartupLocation="Manual"
WindowStyle="None"
mc:Ignorable="d">
<Window.Resources>
<converters:QuerySuggestionBoxConverter x:Key="QuerySuggestionBoxConverter"/>
<converters:BorderClipConverter x:Key="BorderClipConverter"/>
<converters:QuerySuggestionBoxConverter x:Key="QuerySuggestionBoxConverter" />
<converters:BorderClipConverter x:Key="BorderClipConverter" />
</Window.Resources>
<Window.InputBindings>
<KeyBinding Key="Escape" Command="{Binding EscCommand}"></KeyBinding>
<KeyBinding Key="F1" Command="{Binding StartHelpCommand}"></KeyBinding>
<KeyBinding Key="F5" Command="{Binding ReloadPluginDataCommand}"></KeyBinding>
<KeyBinding Key="Tab" Command="{Binding SelectNextItemCommand}"></KeyBinding>
<KeyBinding Key="Tab" Modifiers="Shift" Command="{Binding SelectPrevItemCommand}"></KeyBinding>
<KeyBinding Key="N" Modifiers="Ctrl" Command="{Binding SelectNextItemCommand}"></KeyBinding>
<KeyBinding Key="J" Modifiers="Ctrl" Command="{Binding SelectNextItemCommand}"></KeyBinding>
<KeyBinding Key="D" Modifiers="Ctrl" Command="{Binding SelectNextPageCommand}"></KeyBinding>
<KeyBinding Key="P" Modifiers="Ctrl" Command="{Binding SelectPrevItemCommand}"></KeyBinding>
<KeyBinding Key="K" Modifiers="Ctrl" Command="{Binding SelectPrevItemCommand}"></KeyBinding>
<KeyBinding Key="U" Modifiers="Ctrl" Command="{Binding SelectPrevPageCommand}"></KeyBinding>
<KeyBinding Key="Home" Modifiers="Alt" Command="{Binding SelectFirstResultCommand}"></KeyBinding>
<KeyBinding Key="O" Modifiers="Ctrl" Command="{Binding LoadContextMenuCommand}"></KeyBinding>
<KeyBinding Key="Right" Command="{Binding LoadContextMenuCommand}"></KeyBinding>
<KeyBinding Key="Left" Command="{Binding EscCommand}"></KeyBinding>
<KeyBinding Key="H" Modifiers="Ctrl" Command="{Binding LoadHistoryCommand}"></KeyBinding>
<KeyBinding Key="Enter" Modifiers="Ctrl+Shift" Command="{Binding OpenResultCommand}"></KeyBinding>
<KeyBinding Key="Enter" Modifiers="Shift" Command="{Binding LoadContextMenuCommand}"></KeyBinding>
<KeyBinding Key="Enter" Command="{Binding OpenResultCommand}"></KeyBinding>
<KeyBinding Key="Enter" Modifiers="Ctrl" Command="{Binding OpenResultCommand}"></KeyBinding>
<KeyBinding Key="Enter" Modifiers="Alt" Command="{Binding OpenResultCommand}"></KeyBinding>
<KeyBinding Key="D1" Modifiers="{Binding OpenResultCommandModifiers}" Command="{Binding OpenResultCommand}" CommandParameter="0"></KeyBinding>
<KeyBinding Key="D2" Modifiers="{Binding OpenResultCommandModifiers}" Command="{Binding OpenResultCommand}" CommandParameter="1"></KeyBinding>
<KeyBinding Key="D3" Modifiers="{Binding OpenResultCommandModifiers}" Command="{Binding OpenResultCommand}" CommandParameter="2"></KeyBinding>
<KeyBinding Key="D4" Modifiers="{Binding OpenResultCommandModifiers}" Command="{Binding OpenResultCommand}" CommandParameter="3"></KeyBinding>
<KeyBinding Key="D5" Modifiers="{Binding OpenResultCommandModifiers}" Command="{Binding OpenResultCommand}" CommandParameter="4"></KeyBinding>
<KeyBinding Key="D6" Modifiers="{Binding OpenResultCommandModifiers}" Command="{Binding OpenResultCommand}" CommandParameter="5"></KeyBinding>
<KeyBinding Key="D7" Modifiers="{Binding OpenResultCommandModifiers}" Command="{Binding OpenResultCommand}" CommandParameter="6"></KeyBinding>
<KeyBinding Key="D8" Modifiers="{Binding OpenResultCommandModifiers}" Command="{Binding OpenResultCommand}" CommandParameter="7"></KeyBinding>
<KeyBinding Key="D9" Modifiers="{Binding OpenResultCommandModifiers}" Command="{Binding OpenResultCommand}" CommandParameter="8"></KeyBinding>
<KeyBinding Key="Escape" Command="{Binding EscCommand}" />
<KeyBinding Key="F1" Command="{Binding StartHelpCommand}" />
<KeyBinding Key="F5" Command="{Binding ReloadPluginDataCommand}" />
<KeyBinding Key="Tab" Command="{Binding SelectNextItemCommand}" />
<KeyBinding
Key="Tab"
Command="{Binding SelectPrevItemCommand}"
Modifiers="Shift" />
<KeyBinding
Key="N"
Command="{Binding SelectNextItemCommand}"
Modifiers="Ctrl" />
<KeyBinding
Key="J"
Command="{Binding SelectNextItemCommand}"
Modifiers="Ctrl" />
<KeyBinding
Key="D"
Command="{Binding SelectNextPageCommand}"
Modifiers="Ctrl" />
<KeyBinding
Key="P"
Command="{Binding SelectPrevItemCommand}"
Modifiers="Ctrl" />
<KeyBinding
Key="K"
Command="{Binding SelectPrevItemCommand}"
Modifiers="Ctrl" />
<KeyBinding
Key="U"
Command="{Binding SelectPrevPageCommand}"
Modifiers="Ctrl" />
<KeyBinding
Key="Home"
Command="{Binding SelectFirstResultCommand}"
Modifiers="Alt" />
<KeyBinding
Key="O"
Command="{Binding LoadContextMenuCommand}"
Modifiers="Ctrl" />
<KeyBinding Key="Right" Command="{Binding LoadContextMenuCommand}" />
<KeyBinding Key="Left" Command="{Binding EscCommand}" />
<KeyBinding
Key="H"
Command="{Binding LoadHistoryCommand}"
Modifiers="Ctrl" />
<KeyBinding
Key="Enter"
Command="{Binding OpenResultCommand}"
Modifiers="Ctrl+Shift" />
<KeyBinding
Key="Enter"
Command="{Binding LoadContextMenuCommand}"
Modifiers="Shift" />
<KeyBinding Key="Enter" Command="{Binding OpenResultCommand}" />
<KeyBinding
Key="Enter"
Command="{Binding OpenResultCommand}"
Modifiers="Ctrl" />
<KeyBinding
Key="Enter"
Command="{Binding OpenResultCommand}"
Modifiers="Alt" />
<KeyBinding
Key="D1"
Command="{Binding OpenResultCommand}"
CommandParameter="0"
Modifiers="{Binding OpenResultCommandModifiers}" />
<KeyBinding
Key="D2"
Command="{Binding OpenResultCommand}"
CommandParameter="1"
Modifiers="{Binding OpenResultCommandModifiers}" />
<KeyBinding
Key="D3"
Command="{Binding OpenResultCommand}"
CommandParameter="2"
Modifiers="{Binding OpenResultCommandModifiers}" />
<KeyBinding
Key="D4"
Command="{Binding OpenResultCommand}"
CommandParameter="3"
Modifiers="{Binding OpenResultCommandModifiers}" />
<KeyBinding
Key="D5"
Command="{Binding OpenResultCommand}"
CommandParameter="4"
Modifiers="{Binding OpenResultCommandModifiers}" />
<KeyBinding
Key="D6"
Command="{Binding OpenResultCommand}"
CommandParameter="5"
Modifiers="{Binding OpenResultCommandModifiers}" />
<KeyBinding
Key="D7"
Command="{Binding OpenResultCommand}"
CommandParameter="6"
Modifiers="{Binding OpenResultCommandModifiers}" />
<KeyBinding
Key="D8"
Command="{Binding OpenResultCommand}"
CommandParameter="7"
Modifiers="{Binding OpenResultCommandModifiers}" />
<KeyBinding
Key="D9"
Command="{Binding OpenResultCommand}"
CommandParameter="8"
Modifiers="{Binding OpenResultCommandModifiers}" />
</Window.InputBindings>
<Grid>
<Border Style="{DynamicResource WindowBorderStyle}" MouseDown="OnMouseDown">
<Border MouseDown="OnMouseDown" Style="{DynamicResource WindowBorderStyle}">
<StackPanel Orientation="Vertical">
<Grid>
<TextBox x:Name="QueryTextSuggestionBox"
Style="{DynamicResource QuerySuggestionBoxStyle}"
IsEnabled="False">
<TextBox
x:Name="QueryTextSuggestionBox"
IsEnabled="False"
Style="{DynamicResource QuerySuggestionBoxStyle}">
<TextBox.Text>
<MultiBinding Converter="{StaticResource QuerySuggestionBoxConverter}">
<Binding ElementName="QueryTextBox" Path="Text"/>
<Binding ElementName="ResultListBox" Path="SelectedItem"/>
<Binding ElementName="QueryTextBox" Path="Text" />
<Binding ElementName="ResultListBox" Path="SelectedItem" />
</MultiBinding>
</TextBox.Text>
</TextBox>
<TextBox x:Name="QueryTextBox"
Style="{DynamicResource QueryBoxStyle}"
Text="{Binding QueryText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
PreviewDragOver="OnPreviewDragOver"
AllowDrop="True"
Visibility="Visible"
Background="Transparent">
<TextBox
x:Name="QueryTextBox"
AllowDrop="True"
Background="Transparent"
PreviewDragOver="OnPreviewDragOver"
Style="{DynamicResource QueryBoxStyle}"
Text="{Binding QueryText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Visibility="Visible">
<TextBox.ContextMenu>
<ContextMenu>
<MenuItem Command="ApplicationCommands.Cut"/>
<MenuItem Command="ApplicationCommands.Copy"/>
<MenuItem Command="ApplicationCommands.Paste"/>
<Separator />
<MenuItem Header="{DynamicResource flowlauncher_settings}" Click="OnContextMenusForSettingsClick" />
<MenuItem Command="{Binding EscCommand}" Header="{DynamicResource closeWindow}"/>
<MenuItem Command="ApplicationCommands.Cut" />
<MenuItem Command="ApplicationCommands.Copy" />
<MenuItem Command="ApplicationCommands.Paste" />
<Separator
Margin="0"
Padding="0,4,0,4"
Background="{DynamicResource ContextSeparator}" />
<MenuItem Click="OnContextMenusForSettingsClick" Header="{DynamicResource flowlauncher_settings}" />
<MenuItem Command="{Binding EscCommand}" Header="{DynamicResource closeWindow}" />
</ContextMenu>
</TextBox.ContextMenu>
</TextBox>
<Canvas Style="{DynamicResource SearchIconPosition}">
<Path Data="{DynamicResource SearchIconImg}" Style="{DynamicResource SearchIconStyle}" Margin="0" Stretch="Fill"/>
<Path
Margin="0"
Data="{DynamicResource SearchIconImg}"
Stretch="Fill"
Style="{DynamicResource SearchIconStyle}" />
</Canvas>
</Grid>
@ -121,49 +209,69 @@
</Style.Triggers>
</Style>
</ContentControl.Style>
<Rectangle Width="Auto" HorizontalAlignment="Stretch" Style="{DynamicResource SeparatorStyle}"/>
<Rectangle
Width="Auto"
HorizontalAlignment="Stretch"
Style="{DynamicResource SeparatorStyle}" />
</ContentControl>
<Line x:Name="ProgressBar" HorizontalAlignment="Right"
Style="{DynamicResource PendingLineStyle}" Visibility="{Binding ProgressBarVisibility, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Y1="0" Y2="0" X1="-150" X2="-50" Height="2" Width="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Grid}},Path=ActualWidth}" StrokeThickness="1">
</Line>
<Line
x:Name="ProgressBar"
Width="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Grid}}, Path=ActualWidth}"
Height="2"
HorizontalAlignment="Right"
StrokeThickness="1"
Style="{DynamicResource PendingLineStyle}"
Visibility="{Binding ProgressBarVisibility, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
X1="-150"
X2="-50"
Y1="0"
Y2="0" />
</Grid>
<Border Style="{DynamicResource WindowRadius}">
<Border.Clip>
<MultiBinding Converter="{StaticResource BorderClipConverter}">
<Binding Path="ActualWidth" RelativeSource="{RelativeSource Self}"/>
<Binding Path="ActualHeight" RelativeSource="{RelativeSource Self}"/>
<Binding Path="CornerRadius" RelativeSource="{RelativeSource Self}"/>
<Binding Path="ActualWidth" RelativeSource="{RelativeSource Self}" />
<Binding Path="ActualHeight" RelativeSource="{RelativeSource Self}" />
<Binding Path="CornerRadius" RelativeSource="{RelativeSource Self}" />
</MultiBinding>
</Border.Clip>
<ContentControl>
<flowlauncher:ResultListBox x:Name="ResultListBox" DataContext="{Binding Results}" PreviewMouseDown="OnPreviewMouseButtonDown" />
<flowlauncher:ResultListBox
x:Name="ResultListBox"
DataContext="{Binding Results}"
PreviewMouseDown="OnPreviewMouseButtonDown" />
</ContentControl>
</Border>
<Border Style="{DynamicResource WindowRadius}">
<Border.Clip>
<MultiBinding Converter="{StaticResource BorderClipConverter}">
<Binding Path="ActualWidth" RelativeSource="{RelativeSource Self}"/>
<Binding Path="ActualHeight" RelativeSource="{RelativeSource Self}"/>
<Binding Path="CornerRadius" RelativeSource="{RelativeSource Self}"/>
<Binding Path="ActualWidth" RelativeSource="{RelativeSource Self}" />
<Binding Path="ActualHeight" RelativeSource="{RelativeSource Self}" />
<Binding Path="CornerRadius" RelativeSource="{RelativeSource Self}" />
</MultiBinding>
</Border.Clip>
<ContentControl>
<flowlauncher:ResultListBox DataContext="{Binding ContextMenu}" PreviewMouseDown="OnPreviewMouseButtonDown" x:Name="ContextMenu"/>
</ContentControl>
<ContentControl>
<flowlauncher:ResultListBox
x:Name="ContextMenu"
DataContext="{Binding ContextMenu}"
PreviewMouseDown="OnPreviewMouseButtonDown" />
</ContentControl>
</Border>
<Border Style="{DynamicResource WindowRadius}">
<Border.Clip>
<Border.Clip>
<MultiBinding Converter="{StaticResource BorderClipConverter}">
<Binding Path="ActualWidth" RelativeSource="{RelativeSource Self}"/>
<Binding Path="ActualHeight" RelativeSource="{RelativeSource Self}"/>
<Binding Path="CornerRadius" RelativeSource="{RelativeSource Self}"/>
<Binding Path="ActualWidth" RelativeSource="{RelativeSource Self}" />
<Binding Path="ActualHeight" RelativeSource="{RelativeSource Self}" />
<Binding Path="CornerRadius" RelativeSource="{RelativeSource Self}" />
</MultiBinding>
</Border.Clip>
<ContentControl>
<flowlauncher:ResultListBox DataContext="{Binding History}" PreviewMouseDown="OnPreviewMouseButtonDown" x:Name="History"/>
</ContentControl>
</Border.Clip>
<ContentControl>
<flowlauncher:ResultListBox
x:Name="History"
DataContext="{Binding History}"
PreviewMouseDown="OnPreviewMouseButtonDown" />
</ContentControl>
</Border>
</StackPanel>
</Border>

View file

@ -2693,67 +2693,84 @@
</Style>
<!--#endregion-->
<Thickness x:Key="MenuFlyoutScrollerMargin">0,4,0,4</Thickness>
<Style x:Key="ContextMenuStyleBase" TargetType="ContextMenu">
<Setter Property="Background" Value="{DynamicResource MenuFlyoutPresenterBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource MenuFlyoutPresenterBorderBrush}" />
<Setter Property="BorderThickness" Value="{DynamicResource MenuFlyoutPresenterBorderThemeThickness}" />
<Setter Property="Padding" Value="{DynamicResource MenuFlyoutPresenterThemePadding}" />
<Setter Property="FontFamily" Value="{DynamicResource ContentControlThemeFontFamily}" />
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
<Setter Property="FontStyle" Value="Normal" />
<Setter Property="FontWeight" Value="Normal" />
<Setter Property="Grid.IsSharedSizeScope" Value="true" />
<Setter Property="HasDropShadow" Value="{DynamicResource {x:Static SystemParameters.DropShadowKey}}" />
<!--<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" />-->
<!--<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />-->
<!--<Setter Property="ScrollViewer.PanningMode" Value="VerticalOnly" />-->
<Style TargetType="{x:Type MenuItem}">
<Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
<Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Foreground" Value="{DynamicResource Color05B}" />
<Setter Property="Stylus.IsFlicksEnabled" Value="False" />
<Setter Property="MaxWidth" Value="{DynamicResource FlyoutThemeMaxWidth}" />
<Setter Property="MinHeight" Value="{DynamicResource MenuFlyoutThemeMinHeight}" />
<Setter Property="ui:ControlHelper.CornerRadius" Value="{DynamicResource OverlayCornerRadius}" />
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ContextMenu">
<ui:ThemeShadowChrome
x:Name="Shdw"
IsShadowEnabled="{TemplateBinding HasDropShadow}"
CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}"
SnapsToDevicePixels="True">
<Border
Background="{TemplateBinding Background}"
CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}">
<Grid>
<ScrollViewer
x:Name="ContextMenuScrollViewer"
Style="{DynamicResource {ComponentResourceKey ResourceId=MenuScrollViewer,
TypeInTargetAssembly={x:Type FrameworkElement}}}"
Margin="{TemplateBinding Padding}"
MinWidth="{DynamicResource FlyoutThemeMinWidth}">
<ItemsPresenter
RenderOptions.ClearTypeHint="Enabled"
Margin="{StaticResource MenuFlyoutScrollerMargin}"
KeyboardNavigation.DirectionalNavigation="Cycle"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</ScrollViewer>
<Border
x:Name="ContextMenuBorder"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}" />
</Grid>
</Border>
</ui:ThemeShadowChrome>
<ControlTemplate TargetType="{x:Type MenuItem}">
<Border
Name="bdr"
Padding="24,6,24,6"
Background="Transparent">
<TextBlock
Name="Menu"
VerticalAlignment="Center"
FontSize="14"
Foreground="{DynamicResource Color05B}"
Text="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=Header}" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsVisible" Value="True">
<Setter TargetName="bdr" Property="Background" Value="{DynamicResource CustomContextBackground}" />
<Setter TargetName="Menu" Property="Foreground" Value="{DynamicResource Color05B}" />
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="bdr" Property="Background" Value="{DynamicResource CustomContextHover}" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="Menu" Property="Foreground" Value="{DynamicResource CustomContextDisabled}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="DefaultContextMenuStyle" TargetType="ContextMenu" BasedOn="{StaticResource ContextMenuStyleBase}">
<Style TargetType="{x:Type ContextMenu}">
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ContextMenu}">
<Border
x:Name="Border"
Margin="5,4,5,12"
Padding="0,4,0,4"
Background="{DynamicResource CustomContextBackground}"
BorderBrush="{DynamicResource CustomContextBorder}"
BorderThickness="1"
CornerRadius="8">
<Border.Effect>
<DropShadowEffect
BlurRadius="12"
Direction="-90"
Opacity=".2"
ShadowDepth="6"
Color="#8F8F8F" />
</Border.Effect>
<StackPanel
x:Name="Panel"
ClipToBounds="True"
IsItemsHost="True"
Orientation="Vertical" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsVisible" Value="true">
<Setter TargetName="Border" Property="Background" Value="{DynamicResource CustomContextBackground}" />
<Setter TargetName="Border" Property="BorderBrush" Value="{DynamicResource CustomContextBorder}" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="Border" Property="Background" Value="{DynamicResource CustomContextBackground}" />
<Setter TargetName="Border" Property="BorderBrush" Value="{DynamicResource CustomContextBorder}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="ContextMenu" BasedOn="{StaticResource DefaultContextMenuStyle}" />
</ResourceDictionary>

View file

@ -62,6 +62,13 @@
<SolidColorBrush x:Key="PopupTextColor" Color="#cfcfcf" />
<SolidColorBrush x:Key="PopupButtonAreaBGColor" Color="#2b2b2b" />
<SolidColorBrush x:Key="PopupButtonAreaBorderColor" Color="#3f3f3f" />
<SolidColorBrush x:Key="CustomContextBorder" Color="#1b1b1b" />
<SolidColorBrush x:Key="CustomContextBackground" Color="#2b2b2b" />
<SolidColorBrush x:Key="CustomContextHover" Color="#3c3c3c" />
<SolidColorBrush x:Key="CustomContextDisabled" Color="#868686" />
<SolidColorBrush x:Key="ContextSeparator" Color="#3c3c3c" />
<Color x:Key="Color01">#202020</Color>
<Color x:Key="Color02">#2b2b2b</Color>
<Color x:Key="Color03">#1d1d1d</Color>

View file

@ -55,6 +55,13 @@
<SolidColorBrush x:Key="PopupTextColor" Color="#1b1b1b" />
<SolidColorBrush x:Key="PopupButtonAreaBGColor" Color="#f3f3f3" />
<SolidColorBrush x:Key="PopupButtonAreaBorderColor" Color="#e5e5e5" />
<SolidColorBrush x:Key="CustomContextBorder" Color="#dadada" />
<SolidColorBrush x:Key="CustomContextBackground" Color="#f2f2f2" />
<SolidColorBrush x:Key="CustomContextHover" Color="#DBDBDB" />
<SolidColorBrush x:Key="CustomContextDisabled" Color="#868686" />
<SolidColorBrush x:Key="ContextSeparator" Color="#dadada" />
<Color x:Key="Color01">#f3f3f3</Color>
<Color x:Key="Color02">#ffffff</Color>
<Color x:Key="Color03">#e5e5e5</Color>