feat: extract semi resources.

This commit is contained in:
Zhang Dian
2024-06-26 21:16:31 +08:00
parent c05572b0ad
commit fdb382d03b
3 changed files with 91 additions and 31 deletions

View File

@@ -40,103 +40,103 @@
</Setter>
<Style Selector="^:in-range">
<Setter Property="Background" Value="{DynamicResource SemiColorPrimaryLight}" />
<Setter Property="Background" Value="{DynamicResource DatePickerDayInRangeBackground}" />
<Setter Property="CornerRadius" Value="0" />
<Setter Property="BorderThickness" Value="0" />
</Style>
<Style Selector="^:today">
<Setter Property="Background" Value="{DynamicResource SemiColorFill0}" />
<Setter Property="Foreground" Value="{DynamicResource SemiColorPrimary}" />
<Setter Property="Background" Value="{DynamicResource DatePickerDayTodayBackground}" />
<Setter Property="Foreground" Value="{DynamicResource DatePickerDayTodayForeground}" />
<Setter Property="Cursor" Value="Hand" />
<Style Selector="^:in-range">
<Setter Property="Background" Value="{DynamicResource SemiColorPrimaryLight}" />
<Setter Property="Background" Value="{DynamicResource DatePickerDayInRangeBackground}" />
</Style>
</Style>
<Style Selector="^:not-current-month">
<Setter Property="Foreground" Value="{DynamicResource SemiGrey3}" />
<Setter Property="Foreground" Value="{DynamicResource DatePickerDayNotCurrentMonthForeground}" />
</Style>
<Style Selector="^:pointerover">
<Setter Property="Background" Value="{DynamicResource SemiColorFill0}" />
<Setter Property="Background" Value="{DynamicResource DatePickerDayPointeroverBackground}" />
<Setter Property="Cursor" Value="Hand" />
</Style>
<Style Selector="^:pressed">
<Setter Property="Background" Value="{DynamicResource SemiColorFill1}" />
<Setter Property="Background" Value="{DynamicResource DatePickerDayPressedBackground}" />
</Style>
<Style Selector="^:selected">
<Setter Property="Background" Value="{DynamicResource SemiColorPrimary}" />
<Setter Property="Background" Value="{DynamicResource DatePickerDaySelectedBackground}" />
<Setter Property="CornerRadius" Value="3" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Foreground" Value="White" />
<Style Selector="^:pointerover">
<Setter Property="Background" Value="{DynamicResource SemiColorPrimaryPointerover}" />
<Setter Property="Background" Value="{DynamicResource DatePickerDaySelectedPointeroverBackground}" />
</Style>
<Style Selector="^:pressed">
<Setter Property="Background" Value="{DynamicResource SemiColorPrimaryPressed}" />
<Setter Property="Background" Value="{DynamicResource DatePickerDaySelectedPressedBackground}" />
</Style>
</Style>
<Style Selector="^:start-date">
<Setter Property="CornerRadius" Value="3 0 0 3" />
<Setter Property="Background" Value="{DynamicResource SemiColorPrimary}" />
<Setter Property="BorderBrush" Value="{DynamicResource SemiColorPrimary}" />
<Setter Property="Background" Value="{DynamicResource DatePickerDayStartEndDateBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource DatePickerDayStartEndDateBorderBrush}" />
<Setter Property="Foreground" Value="White" />
<Style Selector="^:pointerover">
<Setter Property="Background" Value="{DynamicResource SemiColorPrimaryPointerover}" />
<Setter Property="Background" Value="{DynamicResource DatePickerDayStartEndDatePointeroverBackground}" />
</Style>
<Style Selector="^:pressed">
<Setter Property="Background" Value="{DynamicResource SemiColorPrimaryPressed}" />
<Setter Property="Background" Value="{DynamicResource DatePickerDayStartEndDatePressedBackground}" />
</Style>
<Style Selector="^:in-range">
<Setter Property="BorderBrush" Value="{DynamicResource SemiColorPrimaryPressed}" />
<Setter Property="BorderBrush" Value="{DynamicResource DatePickerDayStartEndDateInRangeBackground}" />
<Setter Property="BorderThickness" Value="1" />
</Style>
</Style>
<Style Selector="^:end-date">
<Setter Property="CornerRadius" Value="0 3 3 0" />
<Setter Property="Background" Value="{DynamicResource SemiColorPrimary}" />
<Setter Property="BorderBrush" Value="{DynamicResource SemiColorPrimary}" />
<Setter Property="Background" Value="{DynamicResource DatePickerDayStartEndDateBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource DatePickerDayStartEndDateBorderBrush}" />
<Setter Property="Foreground" Value="White" />
<Style Selector="^:pointerover">
<Setter Property="Background" Value="{DynamicResource SemiColorPrimaryPointerover}" />
<Setter Property="Background" Value="{DynamicResource DatePickerDayStartEndDatePointeroverBackground}" />
</Style>
<Style Selector="^:pressed">
<Setter Property="Background" Value="{DynamicResource SemiColorPrimaryPressed}" />
<Setter Property="Background" Value="{DynamicResource DatePickerDayStartEndDatePressedBackground}" />
</Style>
<Style Selector="^:in-range">
<Setter Property="BorderBrush" Value="{DynamicResource SemiColorPrimaryPressed}" />
<Setter Property="BorderBrush" Value="{DynamicResource DatePickerDayStartEndDateInRangeBackground}" />
<Setter Property="BorderThickness" Value="1" />
</Style>
</Style>
<Style Selector="^:preview-start-date">
<Setter Property="CornerRadius" Value="3 0 0 3" />
<Setter Property="Background" Value="{DynamicResource SemiColorPrimaryLightPointerover}" />
<Setter Property="Background" Value="{DynamicResource DatePickerDayPreviewStartEndDateBackground}" />
<Style Selector="^:pressed">
<Setter Property="Background" Value="{DynamicResource SemiColorPrimaryLightActive}" />
<Setter Property="Background" Value="{DynamicResource DatePickerDayPreviewStartEndDatePressedBackground}" />
</Style>
</Style>
<Style Selector="^:preview-end-date">
<Setter Property="CornerRadius" Value="0 3 3 0" />
<Setter Property="Background" Value="{DynamicResource SemiColorPrimaryLightPointerover}" />
<Setter Property="Background" Value="{DynamicResource DatePickerDayPreviewStartEndDateBackground}" />
<Style Selector="^:pressed">
<Setter Property="Background" Value="{DynamicResource SemiColorPrimaryLightActive}" />
<Setter Property="Background" Value="{DynamicResource DatePickerDayPreviewStartEndDatePressedBackground}" />
</Style>
</Style>
<Style Selector="^:blackout">
<Setter Property="Foreground" Value="{DynamicResource SemiColorDisabledText}" />
<Setter Property="Background" Value="{DynamicResource SemiColorDisabledFill}" />
<Setter Property="Foreground" Value="{DynamicResource DatePickerDayBlackoutForeground}" />
<Setter Property="Background" Value="{DynamicResource DatePickerDayBlackoutBackground}" />
<Setter Property="Cursor" Value="No" />
<Style Selector="^:today">
<Setter Property="Foreground" Value="{DynamicResource SemiColorPrimaryDisabled}" />
<Setter Property="Foreground" Value="{DynamicResource DatePickerDayBlackoutTodayBackground}" />
</Style>
</Style>
</ControlTheme>
@@ -169,19 +169,19 @@
</ControlTemplate>
</Setter>
<Style Selector="^:pointerover">
<Setter Property="Background" Value="{DynamicResource SemiColorFill0}" />
<Setter Property="Background" Value="{DynamicResource DatePickerYearPointeroverBackground}" />
<Setter Property="Cursor" Value="Hand" />
</Style>
<Style Selector="^:pressed">
<Setter Property="Background" Value="{DynamicResource SemiColorFill1}" />
<Setter Property="Background" Value="{DynamicResource DatePickerYearPressedBackground}" />
</Style>
<Style Selector="^:selected">
<Setter Property="Background" Value="{DynamicResource SemiColorPrimary}" />
<Setter Property="Background" Value="{DynamicResource DatePickerYearSelectedBackground}" />
<Setter Property="CornerRadius" Value="3" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Foreground" Value="White" />
<Style Selector="^:pointerover">
<Setter Property="Background" Value="{DynamicResource SemiColorPrimaryPointerover}" />
<Setter Property="Background" Value="{DynamicResource DatePickerYearSelectedPointeroverBackground}" />
</Style>
</Style>
</ControlTheme>

View File

@@ -1,2 +1,32 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!--CalenderDayButton-->
<StaticResource x:Key="DatePickerDayInRangeBackground" ResourceKey="SemiColorPrimaryLight" />
<StaticResource x:Key="DatePickerDayTodayBackground" ResourceKey="SemiColorFill0" />
<StaticResource x:Key="DatePickerDayTodayForeground" ResourceKey="SemiColorPrimary" />
<StaticResource x:Key="DatePickerDayNotCurrentMonthForeground" ResourceKey="SemiGrey3" />
<StaticResource x:Key="DatePickerDayPointeroverBackground" ResourceKey="SemiColorFill0" />
<StaticResource x:Key="DatePickerDayPressedBackground" ResourceKey="SemiColorFill1" />
<StaticResource x:Key="DatePickerDaySelectedBackground" ResourceKey="SemiColorPrimary" />
<StaticResource x:Key="DatePickerDaySelectedPointeroverBackground" ResourceKey="SemiColorPrimaryPointerover" />
<StaticResource x:Key="DatePickerDaySelectedPressedBackground" ResourceKey="SemiColorPrimaryPressed" />
<StaticResource x:Key="DatePickerDayStartEndDateBackground" ResourceKey="SemiColorPrimary" />
<StaticResource x:Key="DatePickerDayStartEndDateBorderBrush" ResourceKey="SemiColorPrimary" />
<StaticResource x:Key="DatePickerDayStartEndDatePointeroverBackground" ResourceKey="SemiColorPrimaryPointerover" />
<StaticResource x:Key="DatePickerDayStartEndDatePressedBackground" ResourceKey="SemiColorPrimaryPressed" />
<StaticResource x:Key="DatePickerDayStartEndDateInRangeBackground" ResourceKey="SemiColorPrimaryPressed" />
<StaticResource x:Key="DatePickerDayPreviewStartEndDateBackground" ResourceKey="SemiColorPrimaryLightPointerover" />
<StaticResource x:Key="DatePickerDayPreviewStartEndDatePressedBackground" ResourceKey="SemiColorPrimaryLightActive" />
<StaticResource x:Key="DatePickerDayBlackoutForeground" ResourceKey="SemiColorDisabledText" />
<StaticResource x:Key="DatePickerDayBlackoutBackground" ResourceKey="SemiColorDisabledFill" />
<StaticResource x:Key="DatePickerDayBlackoutTodayBackground" ResourceKey="SemiColorPrimaryDisabled" />
<!--CalenderYearButton-->
<StaticResource x:Key="DatePickerYearPointeroverBackground" ResourceKey="SemiColorFill0" />
<StaticResource x:Key="DatePickerYearPressedBackground" ResourceKey="SemiColorFill1" />
<StaticResource x:Key="DatePickerYearSelectedBackground" ResourceKey="SemiColorPrimary" />
<StaticResource x:Key="DatePickerYearSelectedPointeroverBackground" ResourceKey="SemiColorPrimaryPointerover" />
</ResourceDictionary>

View File

@@ -1,2 +1,32 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!--CalenderDayButton-->
<StaticResource x:Key="DatePickerDayInRangeBackground" ResourceKey="SemiColorPrimaryLight" />
<StaticResource x:Key="DatePickerDayTodayBackground" ResourceKey="SemiColorFill0" />
<StaticResource x:Key="DatePickerDayTodayForeground" ResourceKey="SemiColorPrimary" />
<StaticResource x:Key="DatePickerDayNotCurrentMonthForeground" ResourceKey="SemiGrey3" />
<StaticResource x:Key="DatePickerDayPointeroverBackground" ResourceKey="SemiColorFill0" />
<StaticResource x:Key="DatePickerDayPressedBackground" ResourceKey="SemiColorFill1" />
<StaticResource x:Key="DatePickerDaySelectedBackground" ResourceKey="SemiColorPrimary" />
<StaticResource x:Key="DatePickerDaySelectedPointeroverBackground" ResourceKey="SemiColorPrimaryPointerover" />
<StaticResource x:Key="DatePickerDaySelectedPressedBackground" ResourceKey="SemiColorPrimaryPressed" />
<StaticResource x:Key="DatePickerDayStartEndDateBackground" ResourceKey="SemiColorPrimary" />
<StaticResource x:Key="DatePickerDayStartEndDateBorderBrush" ResourceKey="SemiColorPrimary" />
<StaticResource x:Key="DatePickerDayStartEndDatePointeroverBackground" ResourceKey="SemiColorPrimaryPointerover" />
<StaticResource x:Key="DatePickerDayStartEndDatePressedBackground" ResourceKey="SemiColorPrimaryPressed" />
<StaticResource x:Key="DatePickerDayStartEndDateInRangeBackground" ResourceKey="SemiColorPrimaryPressed" />
<StaticResource x:Key="DatePickerDayPreviewStartEndDateBackground" ResourceKey="SemiColorPrimaryLightPointerover" />
<StaticResource x:Key="DatePickerDayPreviewStartEndDatePressedBackground" ResourceKey="SemiColorPrimaryLightActive" />
<StaticResource x:Key="DatePickerDayBlackoutForeground" ResourceKey="SemiColorDisabledText" />
<StaticResource x:Key="DatePickerDayBlackoutBackground" ResourceKey="SemiColorDisabledFill" />
<StaticResource x:Key="DatePickerDayBlackoutTodayBackground" ResourceKey="SemiColorPrimaryDisabled" />
<!--CalenderYearButton-->
<StaticResource x:Key="DatePickerYearPointeroverBackground" ResourceKey="SemiColorFill0" />
<StaticResource x:Key="DatePickerYearPressedBackground" ResourceKey="SemiColorFill1" />
<StaticResource x:Key="DatePickerYearSelectedBackground" ResourceKey="SemiColorPrimary" />
<StaticResource x:Key="DatePickerYearSelectedPointeroverBackground" ResourceKey="SemiColorPrimaryPointerover" />
</ResourceDictionary>