feat: unified OverlayCloseButton.

This commit is contained in:
Zhang Dian
2025-01-08 21:42:20 +08:00
parent a00b0d2110
commit fa37a0763a
6 changed files with 36 additions and 100 deletions

View File

@@ -126,7 +126,7 @@
x:Name="PART_CloseButton"
VerticalAlignment="Top"
HorizontalAlignment="Right"
Theme="{StaticResource NotificationCloseButton}"
Theme="{StaticResource OverlayCloseButton}"
IsVisible="{TemplateBinding ShowClose}"
u:MessageCard.CloseOnClick="True" />
</DockPanel>
@@ -432,32 +432,4 @@
</Style>
</Style>
</ControlTheme>
<ControlTheme x:Key="NotificationCloseButton" TargetType="Button">
<Setter Property="CornerRadius" Value="6" />
<Setter Property="Height" Value="24" />
<Setter Property="Width" Value="24" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="Foreground" Value="{DynamicResource NotificationCardCloseButtonForeground}" />
<Setter Property="Template">
<ControlTemplate TargetType="Button">
<Border
Name="PART_Border"
Padding="{TemplateBinding Padding}"
Background="Transparent"
CornerRadius="{TemplateBinding CornerRadius}">
<PathIcon
Width="10"
Height="10"
Data="{DynamicResource WindowCloseIconGlyph}" />
</Border>
</ControlTemplate>
</Setter>
<Style Selector="^:pointerover /template/ Border">
<Setter Property="Background" Value="{DynamicResource ButtonDefaultPointeroverBackground}" />
</Style>
<Style Selector="^:pressed /template/ Border">
<Setter Property="Background" Value="{DynamicResource ButtonDefaultPressedBackground}" />
</Style>
</ControlTheme>
</ResourceDictionary>