Browse Source

Tweaked NotificationCard ControlTheme.

pull/8479/head
Steven Kirk 4 years ago
parent
commit
f82541a90d
  1. 1
      src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesDark.xaml
  2. 1
      src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesLight.xaml
  3. 82
      src/Avalonia.Themes.Fluent/Controls/NotificationCard.xaml

1
src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesDark.xaml

@ -308,6 +308,7 @@
<!--Resources for NotificationCard.xaml --> <!--Resources for NotificationCard.xaml -->
<SolidColorBrush x:Key="NotificationCardBackgroundBrush" Color="#444444" /> <SolidColorBrush x:Key="NotificationCardBackgroundBrush" Color="#444444" />
<StaticResource x:Key="NotificationCardForegroundBrush" ResourceKey="SystemControlForegroundBaseHighBrush" />
<SolidColorBrush x:Key="NotificationCardProgressBackgroundBrush" Color="#9A9A9A" /> <SolidColorBrush x:Key="NotificationCardProgressBackgroundBrush" Color="#9A9A9A" />
<SolidColorBrush x:Key="NotificationCardInformationBackgroundBrush" Color="#007ACC" Opacity="0.75"/> <SolidColorBrush x:Key="NotificationCardInformationBackgroundBrush" Color="#007ACC" Opacity="0.75"/>
<SolidColorBrush x:Key="NotificationCardSuccessBackgroundBrush" Color="#1F9E45" Opacity="0.75"/> <SolidColorBrush x:Key="NotificationCardSuccessBackgroundBrush" Color="#1F9E45" Opacity="0.75"/>

1
src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesLight.xaml

@ -304,6 +304,7 @@
<!--Resources for NotificationCard.xaml --> <!--Resources for NotificationCard.xaml -->
<SolidColorBrush x:Key="NotificationCardBackgroundBrush" Color="White" /> <SolidColorBrush x:Key="NotificationCardBackgroundBrush" Color="White" />
<StaticResource x:Key="NotificationCardForegroundBrush" ResourceKey="SystemControlForegroundBaseHighBrush" />
<SolidColorBrush x:Key="NotificationCardProgressBackgroundBrush" Color="#9A9A9A" /> <SolidColorBrush x:Key="NotificationCardProgressBackgroundBrush" Color="#9A9A9A" />
<SolidColorBrush x:Key="NotificationCardInformationBackgroundBrush" Color="#0078D4" /> <SolidColorBrush x:Key="NotificationCardInformationBackgroundBrush" Color="#0078D4" />
<SolidColorBrush x:Key="NotificationCardSuccessBackgroundBrush" Color="#128B44" /> <SolidColorBrush x:Key="NotificationCardSuccessBackgroundBrush" Color="#128B44" />

82
src/Avalonia.Themes.Fluent/Controls/NotificationCard.xaml

@ -9,7 +9,7 @@
<Setter Property="UseLayoutRounding" Value="True"/> <Setter Property="UseLayoutRounding" Value="True"/>
<Setter Property="Width" Value="350"/> <Setter Property="Width" Value="350"/>
<Setter Property="FontSize" Value="14"/> <Setter Property="FontSize" Value="14"/>
<Setter Property="Foreground" Value="White"/> <Setter Property="Foreground" Value="{DynamicResource NotificationCardForegroundBrush}"/>
<Setter Property="RenderTransformOrigin" Value="50%,75%"/> <Setter Property="RenderTransformOrigin" Value="50%,75%"/>
<Setter Property="BorderThickness" Value="0" /> <Setter Property="BorderThickness" Value="0" />
<Setter Property="Background" Value="{DynamicResource NotificationCardBackgroundBrush}" /> <Setter Property="Background" Value="{DynamicResource NotificationCardBackgroundBrush}" />
@ -53,47 +53,47 @@
</Animation> </Animation>
</ControlTheme.Animations> </ControlTheme.Animations>
<Style Selector="^[IsClosing=true] /template/ LayoutTransformControl#PART_LayoutTransformControl"> <Style Selector="^[IsClosing=true] /template/ LayoutTransformControl#PART_LayoutTransformControl">
<Setter Property="RenderTransformOrigin" Value="50%,0%"/> <Setter Property="RenderTransformOrigin" Value="50%,0%"/>
<Style.Animations> <Style.Animations>
<Animation Duration="0:0:0.75" Easing="QuadraticEaseOut" FillMode="Forward"> <Animation Duration="0:0:0.75" Easing="QuadraticEaseOut" FillMode="Forward">
<KeyFrame Cue="0%"> <KeyFrame Cue="0%">
<Setter Property="TranslateTransform.X" Value="0"/> <Setter Property="TranslateTransform.X" Value="0"/>
<Setter Property="ScaleTransform.ScaleY" Value="1"/> <Setter Property="ScaleTransform.ScaleY" Value="1"/>
</KeyFrame> </KeyFrame>
<KeyFrame Cue="70%"> <KeyFrame Cue="70%">
<Setter Property="TranslateTransform.X" Value="800"/> <Setter Property="TranslateTransform.X" Value="800"/>
<Setter Property="ScaleTransform.ScaleY" Value="1"/> <Setter Property="ScaleTransform.ScaleY" Value="1"/>
</KeyFrame> </KeyFrame>
<KeyFrame Cue="100%"> <KeyFrame Cue="100%">
<Setter Property="ScaleTransform.ScaleY" Value="0"/> <Setter Property="ScaleTransform.ScaleY" Value="0"/>
<Setter Property="TranslateTransform.X" Value="800"/> <Setter Property="TranslateTransform.X" Value="800"/>
</KeyFrame> </KeyFrame>
</Animation> </Animation>
</Style.Animations> </Style.Animations>
</Style> </Style>
<Style Selector="^[IsClosing=true]"> <Style Selector="^[IsClosing=true]">
<Style.Animations> <Style.Animations>
<Animation Duration="0:0:1.25" Easing="QuadraticEaseOut" FillMode="Forward"> <Animation Duration="0:0:1.25" Easing="QuadraticEaseOut" FillMode="Forward">
<KeyFrame Cue="100%"> <KeyFrame Cue="100%">
<Setter Property="IsClosed" Value="True"/> <Setter Property="IsClosed" Value="True"/>
</KeyFrame> </KeyFrame>
</Animation> </Animation>
</Style.Animations> </Style.Animations>
</Style> </Style>
<Style Selector="^:information /template/ Panel#PART_HeaderBar"> <Style Selector="^:information /template/ Panel#PART_HeaderBar">
<Setter Property="Background" Value="{DynamicResource NotificationCardInformationBackgroundBrush}"/> <Setter Property="Background" Value="{DynamicResource NotificationCardInformationBackgroundBrush}"/>
</Style> </Style>
<Style Selector="^:success /template/ Panel#PART_HeaderBar"> <Style Selector="^:success /template/ Panel#PART_HeaderBar">
<Setter Property="Background" Value="{DynamicResource NotificationCardSuccessBackgroundBrush}"/> <Setter Property="Background" Value="{DynamicResource NotificationCardSuccessBackgroundBrush}"/>
</Style> </Style>
<Style Selector="^:warning /template/ Panel#PART_HeaderBar"> <Style Selector="^:warning /template/ Panel#PART_HeaderBar">
<Setter Property="Background" Value="{DynamicResource NotificationCardWarningBackgroundBrush}"/> <Setter Property="Background" Value="{DynamicResource NotificationCardWarningBackgroundBrush}"/>
</Style> </Style>
<Style Selector="^:error /template/ Panel#PART_HeaderBar"> <Style Selector="^:error /template/ Panel#PART_HeaderBar">
<Setter Property="Background" Value="{DynamicResource NotificationCardErrorBackgroundBrush}"/> <Setter Property="Background" Value="{DynamicResource NotificationCardErrorBackgroundBrush}"/>
</Style> </Style>
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>

Loading…
Cancel
Save