Browse Source

polish fluent notifications.

pull/4233/head
Dan Walmsley 6 years ago
parent
commit
3acf969fcf
  1. 11
      src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesLight.xaml
  2. 38
      src/Avalonia.Themes.Fluent/NotificationCard.xaml
  3. 2
      src/Avalonia.Themes.Fluent/WindowNotificationManager.xaml

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

@ -492,11 +492,12 @@
<StaticResource x:Key="CalendarViewNavigationButtonBorderBrush" ResourceKey="SystemControlTransparentBrush" /> <StaticResource x:Key="CalendarViewNavigationButtonBorderBrush" ResourceKey="SystemControlTransparentBrush" />
<!--Resources for NotificationCard.xaml --> <!--Resources for NotificationCard.xaml -->
<SolidColorBrush x:Key="NotificationCardBackgroundBrush" Color="#444444" Opacity="0.75"/> <SolidColorBrush x:Key="NotificationCardBackgroundBrush" Color="White" />
<SolidColorBrush x:Key="NotificationCardInformationBackgroundBrush" Color="#007ACC" Opacity="0.75"/> <SolidColorBrush x:Key="NotificationCardProgressBackgroundBrush" Color="#9A9A9A" />
<SolidColorBrush x:Key="NotificationCardSuccessBackgroundBrush" Color="#1F9E45" Opacity="0.75"/> <SolidColorBrush x:Key="NotificationCardInformationBackgroundBrush" Color="#0078D4" />
<SolidColorBrush x:Key="NotificationCardWarningBackgroundBrush" Color="#FDB328" Opacity="0.75"/> <SolidColorBrush x:Key="NotificationCardSuccessBackgroundBrush" Color="#128B44" />
<SolidColorBrush x:Key="NotificationCardErrorBackgroundBrush" Color="#BD202C" Opacity="0.75"/> <SolidColorBrush x:Key="NotificationCardWarningBackgroundBrush" Color="#FFC316" />
<SolidColorBrush x:Key="NotificationCardErrorBackgroundBrush" Color="#F03916" />
<!-- Resources for RadioButton.xaml --> <!-- Resources for RadioButton.xaml -->
<x:Double x:Key="RadioButtonBorderThemeThickness">1</x:Double> <x:Double x:Key="RadioButtonBorderThemeThickness">1</x:Double>

38
src/Avalonia.Themes.Fluent/NotificationCard.xaml

@ -1,8 +1,8 @@
<Styles xmlns="https://github.com/avaloniaui" <Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Design.PreviewWith> <Design.PreviewWith>
<Border Padding="20" Background="#2a2a2a"> <Border Padding="0" Background="White">
<NotificationCard Content="Test" /> <NotificationCard Content="Testing" />
</Border> </Border>
</Design.PreviewWith> </Design.PreviewWith>
<Style Selector="NotificationCard"> <Style Selector="NotificationCard">
@ -11,19 +11,20 @@
<Setter Property="FontSize" Value="14"/> <Setter Property="FontSize" Value="14"/>
<Setter Property="Foreground" Value="White"/> <Setter Property="Foreground" Value="White"/>
<Setter Property="RenderTransformOrigin" Value="50%,75%"/> <Setter Property="RenderTransformOrigin" Value="50%,75%"/>
<Setter Property="BorderThickness" Value="0 4 0 0" /> <Setter Property="BorderThickness" Value="0" />
<Setter Property="Background" Value="{DynamicResource NotificationCardBackgroundBrush}" /> <Setter Property="Background" Value="{DynamicResource NotificationCardBackgroundBrush}" />
<Setter Property="BorderBrush" Value="#F03916" />
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate> <ControlTemplate>
<LayoutTransformControl Name="PART_LayoutTransformControl" UseRenderTransform="True"> <LayoutTransformControl Name="PART_LayoutTransformControl" UseRenderTransform="True">
<Border CornerRadius="{DynamicResource ControlCornerRadius}" BoxShadow="0 5 10 4 #2F000000" Margin="10 0 20 30"> <Border CornerRadius="{DynamicResource ControlCornerRadius}" BoxShadow="0 6 8 0 #4F000000" Margin="5 5 5 10">
<Border Background="{TemplateBinding Background}" <Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}" BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}" BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{DynamicResource ControlCornerRadius}" CornerRadius="{DynamicResource ControlCornerRadius}" ClipToBounds="True">
ClipToBounds="True"> <DockPanel>
<ContentControl Name="PART_Content" Content="{TemplateBinding Content}" /> <Panel x:Name="PART_HeaderBar" Height="4" DockPanel.Dock="Top" />
<ContentControl Name="PART_Content" Content="{TemplateBinding Content}" />
</DockPanel>
</Border> </Border>
</Border> </Border>
</LayoutTransformControl> </LayoutTransformControl>
@ -85,16 +86,19 @@
</Style.Animations> </Style.Animations>
</Style> </Style>
<Style Selector="NotificationCard:information"> <Style Selector="NotificationCard /template/ Panel#PART_HeaderBar">
<Setter Property="BorderBrush" Value="{DynamicResource NotificationCardInformationBackgroundBrush}"/> <Setter Property="Background" Value="{DynamicResource NotificationCardProgressBackgroundBrush}"/>
</Style> </Style>
<Style Selector="NotificationCard:success"> <Style Selector="NotificationCard:information /template/ Panel#PART_HeaderBar">
<Setter Property="BorderBrush" Value="{DynamicResource NotificationCardSuccessBackgroundBrush}"/> <Setter Property="Background" Value="{DynamicResource NotificationCardInformationBackgroundBrush}"/>
</Style> </Style>
<Style Selector="NotificationCard:warning"> <Style Selector="NotificationCard:success /template/ Panel#PART_HeaderBar">
<Setter Property="BorderBrush" Value="{DynamicResource NotificationCardWarningBackgroundBrush}"/> <Setter Property="Background" Value="{DynamicResource NotificationCardSuccessBackgroundBrush}"/>
</Style> </Style>
<Style Selector="NotificationCard:error"> <Style Selector="NotificationCard:warning /template/ Panel#PART_HeaderBar">
<Setter Property="BorderBrush" Value="{DynamicResource NotificationCardErrorBackgroundBrush}"/> <Setter Property="Background" Value="{DynamicResource NotificationCardWarningBackgroundBrush}"/>
</Style>
<Style Selector="NotificationCard:error /template/ Panel#PART_HeaderBar">
<Setter Property="Background" Value="{DynamicResource NotificationCardErrorBackgroundBrush}"/>
</Style> </Style>
</Styles> </Styles>

2
src/Avalonia.Themes.Fluent/WindowNotificationManager.xaml

@ -1,7 +1,7 @@
<Styles xmlns="https://github.com/avaloniaui" <Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style Selector="WindowNotificationManager"> <Style Selector="WindowNotificationManager">
<Setter Property="Margin" Value="0 0 8 8"/> <Setter Property="Margin" Value="0 0"/>
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate> <ControlTemplate>
<ReversibleStackPanel Name="PART_Items"> <ReversibleStackPanel Name="PART_Items">

Loading…
Cancel
Save