Skip to content

Commit

Permalink
修复托盘菜单在切换显示器缩放比例后文字模糊的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
noberumotto committed Aug 5, 2021
1 parent 0587fb9 commit a93e1eb
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 29 deletions.
15 changes: 11 additions & 4 deletions src/Local/ProjectEye/Resources/Themes/Blue/ContextMenu.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,17 @@
<Style TargetType="{x:Type ContextMenu}">
<Setter Property="Background" Value="White"/>
<!--<Setter Property="BorderBrush" Value="{DynamicResource FluentBorderBrush}"/>-->

<Setter Property="Padding" Value="0"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ContextMenu}">

<Grid>
<Border Margin="13" Background="White" CornerRadius="2">
<Border.Effect>
<DropShadowEffect ShadowDepth="0" Direction="0" BlurRadius="15" Opacity=".3" />
</Border.Effect>
</Border>
<Border x:Name="Border"
Background="White"
BorderBrush="#c4c4c4"
Expand All @@ -18,15 +24,16 @@
Margin="10"
CornerRadius="2"
>
<Border.Effect>
<DropShadowEffect BlurRadius="11" Opacity="0.2" Direction="218" RenderingBias="Quality" ShadowDepth="1"/>
</Border.Effect>
<!--<Border.Effect>
<DropShadowEffect ShadowDepth="0" Direction="0" BlurRadius="0" Opacity="0" />
</Border.Effect>-->
<ScrollViewer Focusable="false" Padding="0">

<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>

</ScrollViewer>
</Border>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
Expand Down
22 changes: 14 additions & 8 deletions src/Local/ProjectEye/Resources/Themes/Blue/Menu.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -296,23 +296,29 @@
AllowsTransparency="True"
Focusable="False"
PopupAnimation="Fade">
<Border x:Name="SubmenuBorder"
<Grid>
<Border Margin="13" Background="White" CornerRadius="2">
<Border.Effect>
<DropShadowEffect ShadowDepth="0" Direction="0" BlurRadius="15" Opacity=".3" />
</Border.Effect>
</Border>
<Border x:Name="SubmenuBorder"
SnapsToDevicePixels="True"
Background="White"
CornerRadius="0"
BorderThickness="1"
BorderBrush="#ccc"

Margin="10">
<Border.Effect>
<DropShadowEffect BlurRadius="11" Opacity="0.2" Direction="218" RenderingBias="Quality" ShadowDepth="1"/>
</Border.Effect>
<ScrollViewer CanContentScroll="True"

<ScrollViewer CanContentScroll="True"
>
<StackPanel IsItemsHost="True"
<StackPanel IsItemsHost="True"
KeyboardNavigation.DirectionalNavigation="Cycle" />
</ScrollViewer>
</Border>
</ScrollViewer>
</Border>
</Grid>

</Popup>
</Grid>
</Border>
Expand Down
21 changes: 12 additions & 9 deletions src/Local/ProjectEye/Resources/Themes/Dark/ContextMenu.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,27 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ContextMenu}">

<Border x:Name="Border"
<Grid>
<Border Margin="13" Background="{DynamicResource WindowBackground}" CornerRadius="2">
<Border.Effect>
<DropShadowEffect ShadowDepth="0" Direction="0" BlurRadius="15" Opacity=".3" />
</Border.Effect>
</Border>
<Border x:Name="Border"
Background="{DynamicResource WindowBackground}"
BorderBrush="{DynamicResource WindowBorderBrush}"
BorderThickness="1"
Padding="0"
Margin="10"
CornerRadius="2"
>
<Border.Effect>
<DropShadowEffect BlurRadius="11" Opacity="0.2" Direction="218" RenderingBias="Quality" ShadowDepth="1"/>
</Border.Effect>
<ScrollViewer Focusable="false" Padding="0">
<ScrollViewer Focusable="false" Padding="0">

<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>

</ScrollViewer>
</Border>
</ScrollViewer>
</Border>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
Expand Down
20 changes: 12 additions & 8 deletions src/Local/ProjectEye/Resources/Themes/Dark/Menu.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -296,23 +296,27 @@
AllowsTransparency="True"
Focusable="False"
PopupAnimation="Fade">
<Border x:Name="SubmenuBorder"
<Grid>
<Border Margin="13" Background="{DynamicResource WindowBackground}" CornerRadius="2">
<Border.Effect>
<DropShadowEffect ShadowDepth="0" Direction="0" BlurRadius="15" Opacity=".3" />
</Border.Effect>
</Border>
<Border x:Name="SubmenuBorder"
SnapsToDevicePixels="True"
Background="{DynamicResource WindowBackground}"
CornerRadius="0"
BorderThickness="1"
BorderBrush="{DynamicResource WindowBorderBrush}"

Margin="10">
<Border.Effect>
<DropShadowEffect BlurRadius="11" Opacity="0.2" Direction="218" RenderingBias="Quality" ShadowDepth="1"/>
</Border.Effect>
<ScrollViewer CanContentScroll="True"
<ScrollViewer CanContentScroll="True"
>
<StackPanel IsItemsHost="True"
<StackPanel IsItemsHost="True"
KeyboardNavigation.DirectionalNavigation="Cycle" />
</ScrollViewer>
</Border>
</ScrollViewer>
</Border>
</Grid>
</Popup>
</Grid>
</Border>
Expand Down

0 comments on commit a93e1eb

Please sign in to comment.