WPF blur issue fix?

This commit is contained in:
stax76
2021-10-26 12:24:23 +02:00
parent 99ea7285ba
commit 7cd3a8276d
2 changed files with 3 additions and 6 deletions

View File

@@ -1028,6 +1028,7 @@ namespace mpvnet
MessageBoxEx.ButtonBackground = Theme.Current.GetBrush("highlight"); MessageBoxEx.ButtonBackground = Theme.Current.GetBrush("highlight");
ContextMenu = new WpfControls.ContextMenu(); ContextMenu = new WpfControls.ContextMenu();
ContextMenu.Closed += ContextMenu_Closed; ContextMenu.Closed += ContextMenu_Closed;
ContextMenu.UseLayoutRounding = true;
BuildMenu(); BuildMenu();
System.Windows.Application.Current.ShutdownMode = System.Windows.ShutdownMode.OnExplicitShutdown; System.Windows.Application.Current.ShutdownMode = System.Windows.ShutdownMode.OnExplicitShutdown;
Cursor.Position = new Point(Cursor.Position.X + 1, Cursor.Position.Y); Cursor.Position = new Point(Cursor.Position.X + 1, Cursor.Position.Y);

View File

@@ -266,10 +266,6 @@
<SolidColorBrush o:Freeze="True" x:Key="DarkAccentBrush" Color="{DynamicResource DarkAccentColor}" /> <SolidColorBrush o:Freeze="True" x:Key="DarkAccentBrush" Color="{DynamicResource DarkAccentColor}" />
<SolidColorBrush o:Freeze="True" x:Key="DarkMaskBrush" Color="{DynamicResource DarkMaskColor}" /> <SolidColorBrush o:Freeze="True" x:Key="DarkMaskBrush" Color="{DynamicResource DarkMaskColor}" />
<SolidColorBrush o:Freeze="True" x:Key="DarkOpacityBrush" Color="{DynamicResource DarkOpacityColor}" /> <SolidColorBrush o:Freeze="True" x:Key="DarkOpacityBrush" Color="{DynamicResource DarkOpacityColor}" />
<Color x:Key="EffectShadowColor">#88000000</Color>
<DropShadowEffect x:Key="EffectShadow2" BlurRadius="8" ShadowDepth="1.5" Direction="270" Color="{StaticResource EffectShadowColor}" Opacity=".2" RenderingBias="Performance" o:Freeze="True" />
<Thickness x:Key="DefaultControlPadding">10,6</Thickness> <Thickness x:Key="DefaultControlPadding">10,6</Thickness>
@@ -815,7 +811,7 @@
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="ContextMenu"> <ControlTemplate TargetType="ContextMenu">
<Border Effect="{StaticResource EffectShadow2}" Margin="8" Background="{TemplateBinding Background}" CornerRadius="5" MaxHeight="{TemplateBinding MaxHeight}" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}"> <Border Margin="8" Background="{TemplateBinding Background}" CornerRadius="5" MaxHeight="{TemplateBinding MaxHeight}" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}">
<ScrollViewer Style="{StaticResource ScrollViewerUpDown}" Margin="0,6"> <ScrollViewer Style="{StaticResource ScrollViewerUpDown}" Margin="0,6">
<ItemsPresenter /> <ItemsPresenter />
</ScrollViewer> </ScrollViewer>
@@ -885,7 +881,7 @@
</Border> </Border>
<ContentPresenter x:Name="menuHeaderContainer" ContentTemplate="{TemplateBinding HeaderTemplate}" Grid.Column="1" ContentStringFormat="{TemplateBinding HeaderStringFormat}" ContentSource="Header" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/> <ContentPresenter x:Name="menuHeaderContainer" ContentTemplate="{TemplateBinding HeaderTemplate}" Grid.Column="1" ContentStringFormat="{TemplateBinding HeaderStringFormat}" ContentSource="Header" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
<Popup Grid.Column="0" x:Name="PART_Popup" PlacementTarget="{Binding ElementName=templateRoot}" AllowsTransparency="True" Focusable="False" IsOpen="{Binding IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Bottom"> <Popup Grid.Column="0" x:Name="PART_Popup" PlacementTarget="{Binding ElementName=templateRoot}" AllowsTransparency="True" Focusable="False" IsOpen="{Binding IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Bottom">
<hc:SimplePanel Effect="{StaticResource EffectShadow2}" Margin="8,0,8,8"> <hc:SimplePanel Margin="8,0,8,8">
<Border CornerRadius="0,0,2,2" x:Name="SubMenuBorder" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource RegionBrush}"> <Border CornerRadius="0,0,2,2" x:Name="SubMenuBorder" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource RegionBrush}">
<ScrollViewer Style="{StaticResource ScrollViewerUpDown}" Margin="0,6"> <ScrollViewer Style="{StaticResource ScrollViewerUpDown}" Margin="0,6">
<ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Cycle" Grid.IsSharedSizeScope="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" KeyboardNavigation.TabNavigation="Cycle"/> <ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Cycle" Grid.IsSharedSizeScope="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" KeyboardNavigation.TabNavigation="Cycle"/>