Merge pull request #49 from irihitech/order

Order of Colors
This commit is contained in:
Dong Bin
2023-12-26 15:45:45 +08:00
committed by GitHub
7 changed files with 41 additions and 37 deletions

View File

@@ -24,6 +24,7 @@ public partial class BannerDemo : UserControl
public class BannerDemoViewModel : ViewModelBase
{
private ObservableCollection<NotificationType> _types;
public ObservableCollection<NotificationType> Types
{
get => _types;
@@ -48,6 +49,9 @@ public class BannerDemoViewModel: ViewModelBase
public BannerDemoViewModel()
{
Types = new ObservableCollection<NotificationType>() { NotificationType.Information, NotificationType.Warning, NotificationType.Error, NotificationType.Success };
Types = new ObservableCollection<NotificationType>()
{
NotificationType.Information, NotificationType.Success, NotificationType.Warning, NotificationType.Error
};
}
}

View File

@@ -80,6 +80,19 @@
<Setter Property="PathIcon.Foreground" Value="{DynamicResource BannerInformationBorderBrush}" />
</Style>
</Style>
<Style Selector="^[Type=Success]">
<Style Selector="^.Bordered /template/ Border#PART_Container">
<Setter Property="Border.CornerRadius" Value="{DynamicResource BannerCornerRadius}" />
<Setter Property="BorderBrush" Value="{DynamicResource BannerSuccessBorderBrush}" />
</Style>
<Style Selector="^ /template/ Border#PART_Container">
<Setter Property="Background" Value="{DynamicResource BannerSuccessBackground}" />
</Style>
<Style Selector="^ /template/ PathIcon#PART_BuildInIcon">
<Setter Property="PathIcon.Data" Value="{DynamicResource BannerSuccessIconGeometry}" />
<Setter Property="PathIcon.Foreground" Value="{DynamicResource BannerSuccessBorderBrush}" />
</Style>
</Style>
<Style Selector="^[Type=Warning]">
<Style Selector="^.Bordered /template/ Border#PART_Container">
<Setter Property="Border.CornerRadius" Value="{DynamicResource BannerCornerRadius}" />
@@ -106,18 +119,5 @@
<Setter Property="PathIcon.Foreground" Value="{DynamicResource BannerErrorBorderBrush}" />
</Style>
</Style>
<Style Selector="^[Type=Success]">
<Style Selector="^.Bordered /template/ Border#PART_Container">
<Setter Property="Border.CornerRadius" Value="{DynamicResource BannerCornerRadius}" />
<Setter Property="BorderBrush" Value="{DynamicResource BannerSuccessBorderBrush}" />
</Style>
<Style Selector="^ /template/ Border#PART_Container">
<Setter Property="Background" Value="{DynamicResource BannerSuccessBackground}" />
</Style>
<Style Selector="^ /template/ PathIcon#PART_BuildInIcon">
<Setter Property="PathIcon.Data" Value="{DynamicResource BannerSuccessIconGeometry}" />
<Setter Property="PathIcon.Foreground" Value="{DynamicResource BannerSuccessBorderBrush}" />
</Style>
</Style>
</ControlTheme>
</ResourceDictionary>

View File

@@ -26,10 +26,10 @@
<converters:TimelineItemTypeToIconForegroundConverter
x:Key="ForegroundConverter"
DefaultBrush="{DynamicResource DefaultTimelineIconForeground}"
ErrorBrush="{DynamicResource ErrorTimelineIconForeground}"
OngoingBrush="{DynamicResource OngoingTimelineIconForeground}"
SuccessBrush="{DynamicResource SuccessTimelineIconForeground}"
WarningBrush="{DynamicResource WarningTimelineIconForeground}" />
WarningBrush="{DynamicResource WarningTimelineIconForeground}"
ErrorBrush="{DynamicResource ErrorTimelineIconForeground}" />
<ControlTheme x:Key="{x:Type u:TimelineItem}" TargetType="u:TimelineItem">
<Setter Property="u:TimelineItem.Template">

View File

@@ -42,15 +42,15 @@
<Style Selector="u|ButtonGroup.Tertiary Button">
<Setter Property="Foreground" Value="{DynamicResource ButtonGroupDefaultTertiaryForeground}" />
</Style>
<Style Selector="u|ButtonGroup.Success Button">
<Setter Property="Foreground" Value="{DynamicResource ButtonGroupDefaultSuccessForeground}" />
</Style>
<Style Selector="u|ButtonGroup.Warning Button">
<Setter Property="Foreground" Value="{DynamicResource ButtonGroupDefaultWarningForeground}" />
</Style>
<Style Selector="u|ButtonGroup.Danger Button">
<Setter Property="Foreground" Value="{DynamicResource ButtonGroupDefaultDangerForeground}" />
</Style>
<Style Selector="u|ButtonGroup.Success Button">
<Setter Property="Foreground" Value="{DynamicResource ButtonGroupDefaultSuccessForeground}" />
</Style>
<Style Selector="u|ButtonGroup.Solid.Primary">
<Setter Property="Background" Value="{DynamicResource ButtonGroupSolidPrimaryBackground}" />
@@ -61,15 +61,15 @@
<Style Selector="u|ButtonGroup.Solid.Tertiary">
<Setter Property="Background" Value="{DynamicResource ButtonGroupSolidTertiaryBackground}" />
</Style>
<Style Selector="u|ButtonGroup.Solid.Success">
<Setter Property="Background" Value="{DynamicResource ButtonGroupSolidSuccessBackground}" />
</Style>
<Style Selector="u|ButtonGroup.Solid.Warning">
<Setter Property="Background" Value="{DynamicResource ButtonGroupSolidWarningBackground}" />
</Style>
<Style Selector="u|ButtonGroup.Solid.Danger">
<Setter Property="Background" Value="{DynamicResource ButtonGroupSolidDangerBackground}" />
</Style>
<Style Selector="u|ButtonGroup.Solid.Success">
<Setter Property="Background" Value="{DynamicResource ButtonGroupSolidSuccessBackground}" />
</Style>
<Style Selector="u|ButtonGroup.Solid Button">
<Setter Property="Foreground" Value="{DynamicResource ButtonGroupSolidForeground}" />
</Style>
@@ -100,6 +100,14 @@
<Setter Property="Background" Value="{DynamicResource ButtonGroupSolidTertiaryPressedBackground}" />
</Style>
</Style>
<Style Selector="u|ButtonGroup.Solid.Success Button">
<Style Selector="^:pointerover">
<Setter Property="Background" Value="{DynamicResource ButtonGroupSolidSuccessPointeroverBackground}" />
</Style>
<Style Selector="^:pressed">
<Setter Property="Background" Value="{DynamicResource ButtonGroupSolidSuccessPressedBackground}" />
</Style>
</Style>
<Style Selector="u|ButtonGroup.Solid.Warning Button">
<Style Selector="^:pointerover">
<Setter Property="Background" Value="{DynamicResource ButtonGroupSolidWarningPointeroverBackground}" />
@@ -116,13 +124,5 @@
<Setter Property="Background" Value="{DynamicResource ButtonGroupSolidDangerPressedBackground}" />
</Style>
</Style>
<Style Selector="u|ButtonGroup.Solid.Success Button">
<Style Selector="^:pointerover">
<Setter Property="Background" Value="{DynamicResource ButtonGroupSolidSuccessPointeroverBackground}" />
</Style>
<Style Selector="^:pressed">
<Setter Property="Background" Value="{DynamicResource ButtonGroupSolidSuccessPressedBackground}" />
</Style>
</Style>
</Styles>

View File

@@ -2,12 +2,12 @@
<!-- Add Resources Here -->
<SolidColorBrush x:Key="BannerInformationBackground" Color="#FF053170" />
<SolidColorBrush x:Key="BannerInformationBorderBrush" Color="#FF54A9FF" />
<SolidColorBrush x:Key="BannerSuccessBackground" Color="#FF123C19" />
<SolidColorBrush x:Key="BannerSuccessBorderBrush" Color="#FF5DC264" />
<SolidColorBrush x:Key="BannerWarningBackground" Color="#FF551F03" />
<SolidColorBrush x:Key="BannerWarningBorderBrush" Color="#FFFFAE43" />
<SolidColorBrush x:Key="BannerErrorBackground" Color="#FF6C090B" />
<SolidColorBrush x:Key="BannerErrorBorderBrush" Color="#FFFC725A" />
<SolidColorBrush x:Key="BannerSuccessBackground" Color="#FF123C19" />
<SolidColorBrush x:Key="BannerSuccessBorderBrush" Color="#FF5DC264" />
<SolidColorBrush x:Key="BannerCloseButtonForeground" Opacity="0.6" Color="#FFF9F9F9" />
</ResourceDictionary>

View File

@@ -2,12 +2,12 @@
<!-- Add Resources Here -->
<SolidColorBrush x:Key="BannerInformationBackground" Color="#EAF5FF" />
<SolidColorBrush x:Key="BannerInformationBorderBrush" Color="#0077FA" />
<SolidColorBrush x:Key="BannerSuccessBackground" Color="#ECF7EC" />
<SolidColorBrush x:Key="BannerSuccessBorderBrush" Color="#3BB346" />
<SolidColorBrush x:Key="BannerWarningBackground" Color="#FFF8EA" />
<SolidColorBrush x:Key="BannerWarningBorderBrush" Color="#FC8800" />
<SolidColorBrush x:Key="BannerErrorBackground" Color="#FEF2ED" />
<SolidColorBrush x:Key="BannerErrorBorderBrush" Color="#F93920" />
<SolidColorBrush x:Key="BannerSuccessBackground" Color="#ECF7EC" />
<SolidColorBrush x:Key="BannerSuccessBorderBrush" Color="#3BB346" />
<SolidColorBrush x:Key="BannerCloseButtonForeground" Opacity="0.62" Color="#1C1F23" />
</ResourceDictionary>

View File

@@ -1,9 +1,9 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- Add Resources Here -->
<PathGeometry x:Key="BannerInformationIconGeometry">M12 23C18.0751 23 23 18.0751 23 12C23 5.92487 18.0751 1 12 1C5.92487 1 1 5.92487 1 12C1 18.0751 5.92487 23 12 23ZM14 7C14 8.10457 13.1046 9 12 9C10.8954 9 10 8.10457 10 7C10 5.89543 10.8954 5 12 5C13.1046 5 14 5.89543 14 7ZM9 10.75C9 10.3358 9.33579 10 9.75 10H12.5C13.0523 10 13.5 10.4477 13.5 11V16.5H14.25C14.6642 16.5 15 16.8358 15 17.25C15 17.6642 14.6642 18 14.25 18H9.75C9.33579 18 9 17.6642 9 17.25C9 16.8358 9.33579 16.5 9.75 16.5H10.5V11.5H9.75C9.33579 11.5 9 11.1642 9 10.75Z</PathGeometry>
<PathGeometry x:Key="BannerSuccessIconGeometry">M23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12C1 5.92487 5.92487 1 12 1C18.0751 1 23 5.92487 23 12ZM13.5 17.5C13.5 16.6716 12.8284 16 12 16C11.1716 16 10.5 16.6716 10.5 17.5C10.5 18.3284 11.1716 19 12 19C12.8284 19 13.5 18.3284 13.5 17.5ZM12 5C10.9138 5 10.0507 5.91244 10.1109 6.99692L10.4168 12.5023C10.4635 13.3426 11.1584 14 12 14C12.8416 14 13.5365 13.3426 13.5832 12.5023L13.8891 6.99692C13.9493 5.91244 13.0862 5 12 5Z</PathGeometry>
<PathGeometry x:Key="BannerWarningIconGeometry">M12 23C18.0751 23 23 18.0751 23 12C23 5.92487 18.0751 1 12 1C5.92487 1 1 5.92487 1 12C1 18.0751 5.92487 23 12 23ZM17.8831 9.82235L11.6854 17.4112C11.4029 17.7806 10.965 17.9981 10.5 18C10.035 18.0019 9.59533 17.788 9.30982 17.421L5.81604 13.4209C5.30744 12.767 5.42524 11.8246 6.07916 11.316C6.73308 10.8074 7.67549 10.9252 8.1841 11.5791L10.4838 14.0439L15.5 8C16.0032 7.34193 16.9446 7.21641 17.6027 7.71964C18.2608 8.22287 18.3863 9.16428 17.8831 9.82235Z</PathGeometry>
<PathGeometry x:Key="BannerErrorIconGeometry">M10.2268 2.3986L1.52616 19.0749C0.831449 20.4064 1.79747 22 3.29933 22H20.7007C22.2025 22 23.1686 20.4064 22.4739 19.0749L13.7732 2.3986C13.0254 0.965441 10.9746 0.965442 10.2268 2.3986ZM13.1415 14.0101C13.0603 14.5781 12.5739 15 12.0001 15C11.4263 15 10.9398 14.5781 10.8586 14.0101L10.2829 9.97992C10.1336 8.93495 10.9445 8.00002 12.0001 8.00002C13.0556 8.00002 13.8665 8.93495 13.7172 9.97992L13.1415 14.0101ZM13.5001 18.5C13.5001 19.3284 12.8285 20 12.0001 20C11.1716 20 10.5001 19.3284 10.5001 18.5C10.5001 17.6716 11.1716 17 12.0001 17C12.8285 17 13.5001 17.6716 13.5001 18.5Z</PathGeometry>
<PathGeometry x:Key="BannerSuccessIconGeometry">M23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12C1 5.92487 5.92487 1 12 1C18.0751 1 23 5.92487 23 12ZM13.5 17.5C13.5 16.6716 12.8284 16 12 16C11.1716 16 10.5 16.6716 10.5 17.5C10.5 18.3284 11.1716 19 12 19C12.8284 19 13.5 18.3284 13.5 17.5ZM12 5C10.9138 5 10.0507 5.91244 10.1109 6.99692L10.4168 12.5023C10.4635 13.3426 11.1584 14 12 14C12.8416 14 13.5365 13.3426 13.5832 12.5023L13.8891 6.99692C13.9493 5.91244 13.0862 5 12 5Z</PathGeometry>
<PathGeometry x:Key="BannerCloseIconGeometry">M 17.6568 19.7782 C 18.2426 20.3639 19.1924 20.3639 19.7782 19.7782 C 20.3639 19.1924 20.3639 18.2426 19.7782 17.6568 L 14.1213 12 L 19.7782 6.34313 C 20.3639 5.75734 20.3639 4.8076 19.7782 4.22181 C 19.1924 3.63602 18.2426 3.63602 17.6568 4.22181 L 12 9.87866 L 6.34313 4.22181 C 5.75734 3.63602 4.8076 3.63602 4.22181 4.22181 C 3.63602 4.8076 3.63602 5.75734 4.22181 6.34313 L 9.87866 12 L 4.22181 17.6568 C 3.63602 18.2426 3.63602 19.1924 4.22181 19.7782 C 4.8076 20.3639 5.75734 20.3639 6.34313 19.7782 L 12 14.1213 L 17.6568 19.7782 Z</PathGeometry>
<CornerRadius x:Key="BannerCornerRadius">3</CornerRadius>