feat: replace some Notification resources in Toast.axaml.

This commit is contained in:
Zhang Dian
2024-09-11 21:58:06 +08:00
parent 70d0f236d6
commit c724a71aeb
6 changed files with 26 additions and 8 deletions

View File

@@ -34,9 +34,9 @@
<ControlTheme x:Key="{x:Type u:ToastCard}" TargetType="u:ToastCard">
<Setter Property="UseLayoutRounding" Value="True" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="BorderThickness" Value="{DynamicResource NotificationCardBorderThickness}" />
<Setter Property="Background" Value="{DynamicResource NotificationCardBackground}" />
<Setter Property="CornerRadius" Value="{DynamicResource NotificationCardCornerRadius}" />
<Setter Property="BorderThickness" Value="{DynamicResource ToastCardBorderThickness}" />
<Setter Property="Background" Value="{DynamicResource ToastCardBackground}" />
<Setter Property="CornerRadius" Value="{DynamicResource ToastCardCornerRadius}" />
<Setter Property="Template">
<ControlTemplate TargetType="u:ToastCard">
<LayoutTransformControl x:Name="PART_LayoutTransformControl" UseRenderTransform="True">
@@ -56,8 +56,8 @@
<DockPanel>
<PathIcon
x:Name="ToastIcon"
Width="{DynamicResource NotificationCardIconWidth}"
Height="{DynamicResource NotificationCardIconHeight}"
Width="{DynamicResource ToastCardIconWidth}"
Height="{DynamicResource ToastCardIconHeight}"
Margin="{DynamicResource ToastCardIconMargin}"
VerticalAlignment="Top"
IsVisible="{TemplateBinding ShowIcon}"
@@ -71,14 +71,14 @@
<ContentControl.DataTemplates>
<DataTemplate DataType="u:IToast">
<SelectableTextBlock
Foreground="{DynamicResource NotificationCardTitleForeground}"
Foreground="{DynamicResource ToastCardContentForeground}"
FontWeight="{DynamicResource ToastCardContentFontWeight}"
Text="{Binding Content}"
TextWrapping="Wrap" />
</DataTemplate>
<DataTemplate DataType="x:String">
<SelectableTextBlock
Foreground="{DynamicResource NotificationCardTitleForeground}"
Foreground="{DynamicResource ToastCardContentForeground}"
FontWeight="{DynamicResource ToastCardContentFontWeight}"
Text="{Binding}"
TextWrapping="Wrap" />

View File

@@ -0,0 +1,5 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="ToastCardContentForeground" Color="#F9F9F9" />
<SolidColorBrush x:Key="ToastCardBackground" Color="#43444A" />
</ResourceDictionary>

View File

@@ -17,6 +17,7 @@
<MergeResourceInclude Source="Rating.axaml" />
<MergeResourceInclude Source="TagInput.axaml" />
<MergeResourceInclude Source="Timeline.axaml" />
<MergeResourceInclude Source="Toast.axaml" />
<MergeResourceInclude Source="Skeleton.axaml" />
<MergeResourceInclude Source="TimeBox.axaml" />
</ResourceDictionary.MergedDictionaries>

View File

@@ -0,0 +1,5 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="ToastCardContentForeground" Color="#1C1F23" />
<SolidColorBrush x:Key="ToastCardBackground" Color="White" />
</ResourceDictionary>

View File

@@ -17,6 +17,7 @@
<MergeResourceInclude Source="Rating.axaml" />
<MergeResourceInclude Source="TagInput.axaml" />
<MergeResourceInclude Source="Timeline.axaml" />
<MergeResourceInclude Source="Toast.axaml" />
<MergeResourceInclude Source="Skeleton.axaml" />
<MergeResourceInclude Source="TimeBox.axaml" />
</ResourceDictionary.MergedDictionaries>

View File

@@ -1,8 +1,14 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<x:Double x:Key="ToastCardMinHeight">40</x:Double>
<Thickness x:Key="ToastCardPadding">12 8</Thickness>
<Thickness x:Key="ToastCardBorderThickness">1</Thickness>
<CornerRadius x:Key="ToastCardCornerRadius">6</CornerRadius>
<Thickness x:Key="ToastCardMargin">12</Thickness>
<Thickness x:Key="ToastCardPadding">12 8</Thickness>
<x:Double x:Key="ToastCardIconWidth">18</x:Double>
<x:Double x:Key="ToastCardIconHeight">18</x:Double>
<Thickness x:Key="ToastCardIconMargin">0 2 0 0</Thickness>
<FontWeight x:Key="ToastCardContentFontWeight">600</FontWeight>