fix: fix Notification BoxShadows & MinWidth.
This commit is contained in:
parent
16e8c475a1
commit
b0b06b4edc
@ -5,16 +5,17 @@
|
|||||||
<Design.PreviewWith>
|
<Design.PreviewWith>
|
||||||
<ThemeVariantScope RequestedThemeVariant="Dark">
|
<ThemeVariantScope RequestedThemeVariant="Dark">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
|
<NotificationCard />
|
||||||
<NotificationCard>
|
<NotificationCard>
|
||||||
Hello, Semi.Avalonia!
|
Hello, Semi.Avalonia!
|
||||||
</NotificationCard>
|
</NotificationCard>
|
||||||
<NotificationCard NotificationType="Success">
|
<NotificationCard NotificationType="Success">
|
||||||
<Notification Title="Welcome" Message="Hello, Semi.Avalonia!" />
|
<Notification Title="Welcome" Message="Hello, Semi.Avalonia!" />
|
||||||
</NotificationCard>
|
</NotificationCard>
|
||||||
<NotificationCard NotificationType="Warning">
|
<NotificationCard NotificationType="Warning" Classes="Light">
|
||||||
<Notification Title="" Message="Hello, Semi.Avalonia!" />
|
<Notification Title="Welcome" />
|
||||||
</NotificationCard>
|
</NotificationCard>
|
||||||
<NotificationCard NotificationType="Error">
|
<NotificationCard NotificationType="Error" Classes="Light">
|
||||||
<Notification Message="Hello, Semi.Avalonia!" />
|
<Notification Message="Hello, Semi.Avalonia!" />
|
||||||
</NotificationCard>
|
</NotificationCard>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
@ -22,10 +23,7 @@
|
|||||||
</Design.PreviewWith>
|
</Design.PreviewWith>
|
||||||
<ControlTheme x:Key="{x:Type NotificationCard}" TargetType="NotificationCard">
|
<ControlTheme x:Key="{x:Type NotificationCard}" TargetType="NotificationCard">
|
||||||
<Setter Property="UseLayoutRounding" Value="True" />
|
<Setter Property="UseLayoutRounding" Value="True" />
|
||||||
<Setter Property="MinWidth" Value="{DynamicResource NotificationCardMinWidth}" />
|
|
||||||
<Setter Property="RenderTransformOrigin" Value="50%,75%" />
|
|
||||||
<Setter Property="BorderThickness" Value="{DynamicResource NotificationCardBorderThickness}" />
|
<Setter Property="BorderThickness" Value="{DynamicResource NotificationCardBorderThickness}" />
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource NotificationCardBorderBrush}" />
|
|
||||||
<Setter Property="Background" Value="{DynamicResource NotificationCardBackground}" />
|
<Setter Property="Background" Value="{DynamicResource NotificationCardBackground}" />
|
||||||
<Setter Property="CornerRadius" Value="{DynamicResource NotificationCardCornerRadius}" />
|
<Setter Property="CornerRadius" Value="{DynamicResource NotificationCardCornerRadius}" />
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
@ -38,11 +36,11 @@
|
|||||||
<Border
|
<Border
|
||||||
x:Name="PART_RootBorder"
|
x:Name="PART_RootBorder"
|
||||||
Padding="{DynamicResource NotificationCardPadding}"
|
Padding="{DynamicResource NotificationCardPadding}"
|
||||||
BoxShadow="{DynamicResource NotificationCardBoxShadow}"
|
BoxShadow="{DynamicResource NotificationCardBoxShadows}"
|
||||||
BorderBrush="{TemplateBinding BorderBrush}"
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||||||
BorderThickness="{TemplateBinding BorderThickness}"
|
BorderThickness="{TemplateBinding BorderThickness}"
|
||||||
CornerRadius="{TemplateBinding CornerRadius}">
|
CornerRadius="{TemplateBinding CornerRadius}">
|
||||||
<DockPanel>
|
<DockPanel MinWidth="{DynamicResource NotificationCardMinWidth}">
|
||||||
<PathIcon
|
<PathIcon
|
||||||
Name="NotificationIcon"
|
Name="NotificationIcon"
|
||||||
Width="{DynamicResource NotificationCardIconWidth}"
|
Width="{DynamicResource NotificationCardIconWidth}"
|
||||||
@ -67,6 +65,7 @@
|
|||||||
Foreground="{DynamicResource NotificationCardMessageForeground}"
|
Foreground="{DynamicResource NotificationCardMessageForeground}"
|
||||||
FontSize="{DynamicResource NotificationCardMessageFontSize}"
|
FontSize="{DynamicResource NotificationCardMessageFontSize}"
|
||||||
FontWeight="{DynamicResource NotificationCardMessageFontWeight}"
|
FontWeight="{DynamicResource NotificationCardMessageFontWeight}"
|
||||||
|
IsVisible="{Binding Message, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
|
||||||
Text="{Binding Message}"
|
Text="{Binding Message}"
|
||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<SolidColorBrush x:Key="NotificationCardSuccessIconForeground" Color="#5DC264" />
|
<SolidColorBrush x:Key="NotificationCardSuccessIconForeground" Color="#5DC264" />
|
||||||
<SolidColorBrush x:Key="NotificationCardWarningIconForeground" Color="#FFAE43" />
|
<SolidColorBrush x:Key="NotificationCardWarningIconForeground" Color="#FFAE43" />
|
||||||
<SolidColorBrush x:Key="NotificationCardErrorIconForeground" Color="#FC725A" />
|
<SolidColorBrush x:Key="NotificationCardErrorIconForeground" Color="#FC725A" />
|
||||||
<BoxShadows x:Key="NotificationCardBoxShadows">0 0 8 0 #1AFFFFFF</BoxShadows>
|
<BoxShadows x:Key="NotificationCardBoxShadows">inset 0 0 0 1 #1AFFFFFF, 0 4 14 0 #40000000</BoxShadows>
|
||||||
<SolidColorBrush x:Key="NotificationCardTitleForeground" Color="#F9F9F9" />
|
<SolidColorBrush x:Key="NotificationCardTitleForeground" Color="#F9F9F9" />
|
||||||
<SolidColorBrush x:Key="NotificationCardMessageForeground" Opacity="0.8" Color="#F9F9F9" />
|
<SolidColorBrush x:Key="NotificationCardMessageForeground" Opacity="0.8" Color="#F9F9F9" />
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<SolidColorBrush x:Key="NotificationCardSuccessIconForeground" Color="#3BB346" />
|
<SolidColorBrush x:Key="NotificationCardSuccessIconForeground" Color="#3BB346" />
|
||||||
<SolidColorBrush x:Key="NotificationCardWarningIconForeground" Color="#FC8800" />
|
<SolidColorBrush x:Key="NotificationCardWarningIconForeground" Color="#FC8800" />
|
||||||
<SolidColorBrush x:Key="NotificationCardErrorIconForeground" Color="#F93920" />
|
<SolidColorBrush x:Key="NotificationCardErrorIconForeground" Color="#F93920" />
|
||||||
<BoxShadows x:Key="NotificationCardBoxShadows">0 0 8 0 #1A000000</BoxShadows>
|
<BoxShadows x:Key="NotificationCardBoxShadows">0 0 1 0 #4A000000, 0 4 14 0 #1A000000</BoxShadows>
|
||||||
<SolidColorBrush x:Key="NotificationCardTitleForeground" Color="#1C1F23" />
|
<SolidColorBrush x:Key="NotificationCardTitleForeground" Color="#1C1F23" />
|
||||||
<SolidColorBrush x:Key="NotificationCardMessageForeground" Opacity="0.8" Color="#1C1F23" />
|
<SolidColorBrush x:Key="NotificationCardMessageForeground" Opacity="0.8" Color="#1C1F23" />
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
@ -3,7 +3,7 @@
|
|||||||
<Thickness x:Key="NotificationCardBorderThickness">1</Thickness>
|
<Thickness x:Key="NotificationCardBorderThickness">1</Thickness>
|
||||||
<CornerRadius x:Key="NotificationCardCornerRadius">6</CornerRadius>
|
<CornerRadius x:Key="NotificationCardCornerRadius">6</CornerRadius>
|
||||||
<Thickness x:Key="NotificationCardMargin">8</Thickness>
|
<Thickness x:Key="NotificationCardMargin">8</Thickness>
|
||||||
<Thickness x:Key="NotificationCardPadding">16 12</Thickness>
|
<Thickness x:Key="NotificationCardPadding">20 16 12 16</Thickness>
|
||||||
|
|
||||||
<x:Double x:Key="NotificationCardIconWidth">18</x:Double>
|
<x:Double x:Key="NotificationCardIconWidth">18</x:Double>
|
||||||
<x:Double x:Key="NotificationCardIconHeight">18</x:Double>
|
<x:Double x:Key="NotificationCardIconHeight">18</x:Double>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user