fix: using DropShadowEffect in Launcher's popup container on Linux will get a wrong render result.

This commit is contained in:
leo 2024-03-08 15:52:40 +08:00
parent 2182d39e5f
commit 8c1fe66ee5
4 changed files with 99 additions and 72 deletions

View file

@ -251,21 +251,44 @@
<Setter Property="Foreground" Value="{DynamicResource Brush.FG1}"/>
<Setter Property="Background" Value="{DynamicResource Brush.FlatButton.Background}"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Effect">
<Setter.Value>
<DropShadowEffect BlurRadius="2" OffsetX="0" OffsetY="0" Color="Black" Opacity=".65"/>
</Setter.Value>
<Setter Property="Template">
<ControlTemplate>
<Grid>
<Border x:Name="PART_Border"
Margin="2"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}"
Effect="drop-shadow(0 0 2 #80000000)"/>
<ContentPresenter x:Name="PART_ContentPresenter"
Margin="2"
Background="Transparent"
Padding="{TemplateBinding Padding}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"/>
</Grid>
</ControlTemplate>
</Setter>
</Style>
<Style Selector="Button.flat:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Style Selector="Button.flat:pointerover /template/ Border#PART_Border">
<Setter Property="Background" Value="{DynamicResource Brush.FlatButton.BackgroundHovered}"/>
</Style>
<Style Selector="Button.flat:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="Transparent"/>
</Style>
<Style Selector="Button.flat.primary">
<Setter Property="Background" Value="{DynamicResource Brush.FlatButton.PrimaryBackground}"/>
</Style>
<Style Selector="Button.flat.primary:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Style Selector="Button.flat.primary:pointerover /template/ Border#PART_Border">
<Setter Property="Background" Value="{DynamicResource Brush.FlatButton.PrimaryBackgroundHovered}"/>
</Style>
<Style Selector="Button.flat.primary:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="Transparent"/>
</Style>
<Style Selector="Border.launcher_pagetab">
<Setter Property="Background" Value="Transparent"/>