279 lines
13 KiB
XML
279 lines
13 KiB
XML
<Styles xmlns="https://github.com/avaloniaui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
|
|
|
<Design.PreviewWith>
|
|
<Border Padding="20" Background="#0D0F14">
|
|
<Calendar SelectionMode="SingleRange"/>
|
|
</Border>
|
|
</Design.PreviewWith>
|
|
|
|
<!-- FluentCalendarButton (header + prev/next) -->
|
|
<Style Selector="Button.FluentCalendarButton, Button#PART_HeaderButton, Button#PART_PreviousButton, Button#PART_NextButton">
|
|
<Setter Property="Background" Value="Transparent"/>
|
|
<Setter Property="BorderThickness" Value="0"/>
|
|
<Setter Property="Foreground" Value="{DynamicResource TextPrimary}"/>
|
|
<Setter Property="FontWeight" Value="SemiBold"/>
|
|
<Setter Property="FontSize" Value="13"/>
|
|
<Setter Property="Cursor" Value="Hand"/>
|
|
<Setter Property="FocusAdorner" Value="{x:Null}"/>
|
|
</Style>
|
|
<Style Selector="Button.FluentCalendarButton:pointerover, Button#PART_HeaderButton:pointerover, Button#PART_PreviousButton:pointerover, Button#PART_NextButton:pointerover">
|
|
<Setter Property="Background" Value="{DynamicResource BgHover}"/>
|
|
</Style>
|
|
<Style Selector="Button.FluentCalendarButton:pressed, Button#PART_HeaderButton:pressed, Button#PART_PreviousButton:pressed, Button#PART_NextButton:pressed">
|
|
<Setter Property="Background" Value="{DynamicResource BorderSubtle}"/>
|
|
</Style>
|
|
|
|
<!-- Calendar root -->
|
|
<Style Selector="Calendar">
|
|
<Setter Property="CornerRadius" Value="{DynamicResource RadiusControl}"/>
|
|
<Setter Property="BorderBrush" Value="{DynamicResource BgSurface}"/>
|
|
<Setter Property="Background" Value="{DynamicResource BgSurface}"/>
|
|
<Setter Property="Foreground" Value="{DynamicResource TextPrimary}"/>
|
|
</Style>
|
|
|
|
<!-- CalendarItem (the main container) -->
|
|
<Style Selector="CalendarItem">
|
|
<Setter Property="Foreground" Value="{DynamicResource TextPrimary}"/>
|
|
<Setter Property="Background" Value="{DynamicResource BgSurface}"/>
|
|
<Setter Property="BorderBrush" Value="{DynamicResource BorderSubtle}"/>
|
|
<Setter Property="CornerRadius" Value="{DynamicResource RadiusControl}"/>
|
|
<Setter Property="BorderThickness" Value="1"/>
|
|
<Setter Property="FontSize" Value="13"/>
|
|
<Setter Property="Template">
|
|
<ControlTemplate>
|
|
<Border BorderThickness="{TemplateBinding BorderThickness}"
|
|
Background="{TemplateBinding Background}"
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
CornerRadius="{TemplateBinding CornerRadius}"
|
|
ClipToBounds="True">
|
|
<Grid VerticalAlignment="Stretch"
|
|
HorizontalAlignment="Stretch"
|
|
RowDefinitions="44,*"
|
|
MinWidth="294"
|
|
Background="{TemplateBinding Background}">
|
|
|
|
<!-- Header row: title + prev/next -->
|
|
<Grid ColumnDefinitions="*,36,36" Margin="8,0,4,0">
|
|
<Button Name="PART_HeaderButton"
|
|
Theme="{StaticResource FluentCalendarButton}"
|
|
Foreground="{TemplateBinding Foreground}"
|
|
Padding="8,0,0,0"
|
|
CornerRadius="{DynamicResource RadiusControl}"
|
|
HorizontalContentAlignment="Left"
|
|
VerticalAlignment="Center"
|
|
FontSize="13"
|
|
FontWeight="SemiBold"/>
|
|
<Button Name="PART_PreviousButton"
|
|
Grid.Column="1"
|
|
Theme="{StaticResource FluentCalendarButton}"
|
|
Foreground="{TemplateBinding Foreground}"
|
|
CornerRadius="{DynamicResource RadiusControl}"
|
|
Width="32" Height="32"
|
|
Padding="0"
|
|
HorizontalContentAlignment="Center"
|
|
VerticalAlignment="Center">
|
|
<Path Stroke="{DynamicResource TextMuted}"
|
|
StrokeThickness="1.5"
|
|
Data="M 0,8 L 8,0 L 16,8"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"/>
|
|
</Button>
|
|
<Button Name="PART_NextButton"
|
|
Grid.Column="2"
|
|
Theme="{StaticResource FluentCalendarButton}"
|
|
Foreground="{TemplateBinding Foreground}"
|
|
CornerRadius="{DynamicResource RadiusControl}"
|
|
Width="32" Height="32"
|
|
Padding="0"
|
|
HorizontalContentAlignment="Center"
|
|
VerticalAlignment="Center">
|
|
<Path Stroke="{DynamicResource TextMuted}"
|
|
StrokeThickness="1.5"
|
|
Data="M 0,0 L 8,8 L 16,0"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"/>
|
|
</Button>
|
|
</Grid>
|
|
|
|
<!-- Separator under header -->
|
|
<Border Grid.Row="0"
|
|
VerticalAlignment="Bottom"
|
|
Height="1"
|
|
Background="{DynamicResource BorderSubtle}"
|
|
Margin="8,0"/>
|
|
|
|
<!-- Month grid -->
|
|
<Grid Name="PART_MonthView"
|
|
Grid.Row="1"
|
|
IsVisible="False"
|
|
MinHeight="290"
|
|
Background="{TemplateBinding Background}">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="36"/>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
</Grid.ColumnDefinitions>
|
|
</Grid>
|
|
|
|
<!-- Year/decade grid -->
|
|
<Grid Name="PART_YearView"
|
|
Grid.Row="1"
|
|
MinHeight="290"
|
|
IsVisible="False"
|
|
Background="{TemplateBinding Background}">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="*"/>
|
|
<RowDefinition Height="*"/>
|
|
<RowDefinition Height="*"/>
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
</Grid>
|
|
|
|
</Grid>
|
|
</Border>
|
|
</ControlTemplate>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<!-- CalendarDayButton -->
|
|
<Style Selector="CalendarDayButton">
|
|
<Setter Property="Width" Value="38"/>
|
|
<Setter Property="Height" Value="38"/>
|
|
<Setter Property="Padding" Value="0"/>
|
|
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
|
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
|
<Setter Property="Background" Value="Transparent"/>
|
|
<Setter Property="Foreground" Value="{DynamicResource TextSecondary}"/>
|
|
<Setter Property="FontSize" Value="13"/>
|
|
<Setter Property="Cursor" Value="Hand"/>
|
|
<Setter Property="FocusAdorner" Value="{x:Null}"/>
|
|
<Setter Property="Template">
|
|
<ControlTemplate>
|
|
<Panel>
|
|
<Border Name="Root"
|
|
Background="{TemplateBinding Background}"
|
|
CornerRadius="{DynamicResource RadiusIcon}"
|
|
ClipToBounds="True">
|
|
<ContentPresenter Name="PART_ContentPresenter"
|
|
Content="{TemplateBinding Content}"
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
|
Margin="{TemplateBinding Padding}"
|
|
Foreground="{TemplateBinding Foreground}"/>
|
|
</Border>
|
|
<Border Name="Border"
|
|
BorderThickness="2"
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
CornerRadius="{DynamicResource RadiusIcon}"/>
|
|
</Panel>
|
|
</ControlTemplate>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<!-- hover -->
|
|
<Style Selector="CalendarDayButton:pointerover /template/ Border#Root">
|
|
<Setter Property="Background" Value="{DynamicResource BgHover}"/>
|
|
</Style>
|
|
<Style Selector="CalendarDayButton:pointerover /template/ ContentPresenter#PART_ContentPresenter">
|
|
<Setter Property="Foreground" Value="{DynamicResource TextPrimary}"/>
|
|
</Style>
|
|
|
|
<!-- pressed -->
|
|
<Style Selector="CalendarDayButton:pressed /template/ Border#Root">
|
|
<Setter Property="Background" Value="{DynamicResource BorderSubtle}"/>
|
|
</Style>
|
|
|
|
<!-- selected -->
|
|
<Style Selector="CalendarDayButton:selected /template/ Border#Root">
|
|
<Setter Property="Background" Value="{DynamicResource AccentBlue}"/>
|
|
</Style>
|
|
<Style Selector="CalendarDayButton:selected /template/ ContentPresenter#PART_ContentPresenter">
|
|
<Setter Property="Foreground" Value="{DynamicResource BgBase}"/>
|
|
<Setter Property="FontWeight" Value="SemiBold"/>
|
|
</Style>
|
|
<Style Selector="CalendarDayButton:selected:pointerover /template/ Border#Root">
|
|
<Setter Property="Background" Value="{DynamicResource AccentBlue}"/>
|
|
</Style>
|
|
|
|
<!-- today -->
|
|
<Style Selector="CalendarDayButton:today /template/ Border#Root">
|
|
<Setter Property="Background" Value="{DynamicResource IconBgBlue}"/>
|
|
</Style>
|
|
<Style Selector="CalendarDayButton:today /template/ ContentPresenter#PART_ContentPresenter">
|
|
<Setter Property="Foreground" Value="{DynamicResource AccentBlue}"/>
|
|
<Setter Property="FontWeight" Value="Bold"/>
|
|
</Style>
|
|
<Style Selector="CalendarDayButton:today:selected /template/ Border#Root">
|
|
<Setter Property="Background" Value="{DynamicResource AccentBlue}"/>
|
|
</Style>
|
|
<Style Selector="CalendarDayButton:today:selected /template/ ContentPresenter#PART_ContentPresenter">
|
|
<Setter Property="Foreground" Value="{DynamicResource BgBase}"/>
|
|
</Style>
|
|
|
|
<!-- inactive (days from prev/next month) -->
|
|
<Style Selector="CalendarDayButton:inactive /template/ ContentPresenter#PART_ContentPresenter">
|
|
<Setter Property="Foreground" Value="{DynamicResource TextDisabled}"/>
|
|
</Style>
|
|
<Style Selector="CalendarDayButton:inactive /template/ Border#Root">
|
|
<Setter Property="Background" Value="Transparent"/>
|
|
</Style>
|
|
|
|
<!-- blackout -->
|
|
<Style Selector="CalendarDayButton:blackout /template/ ContentPresenter#PART_ContentPresenter">
|
|
<Setter Property="Foreground" Value="{DynamicResource TextDisabled}"/>
|
|
<Setter Property="Opacity" Value="0.4"/>
|
|
</Style>
|
|
|
|
<!-- CalendarButton (month/year picker cells) -->
|
|
<Style Selector="CalendarButton">
|
|
<Setter Property="Width" Value="60"/>
|
|
<Setter Property="Height" Value="52"/>
|
|
<Setter Property="Padding" Value="0"/>
|
|
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
|
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
|
<Setter Property="Background" Value="Transparent"/>
|
|
<Setter Property="Foreground" Value="{DynamicResource TextSecondary}"/>
|
|
<Setter Property="FontSize" Value="13"/>
|
|
<Setter Property="Cursor" Value="Hand"/>
|
|
<Setter Property="FocusAdorner" Value="{x:Null}"/>
|
|
<Setter Property="CornerRadius" Value="{DynamicResource RadiusControl}"/>
|
|
</Style>
|
|
<Style Selector="CalendarButton:pointerover /template/ ContentPresenter">
|
|
<Setter Property="Background" Value="{DynamicResource BgHover}"/>
|
|
<Setter Property="Foreground" Value="{DynamicResource TextPrimary}"/>
|
|
</Style>
|
|
<Style Selector="CalendarButton:pressed /template/ ContentPresenter">
|
|
<Setter Property="Background" Value="{DynamicResource BorderSubtle}"/>
|
|
</Style>
|
|
<Style Selector="CalendarButton:selected /template/ ContentPresenter">
|
|
<Setter Property="Background" Value="{DynamicResource AccentBlue}"/>
|
|
<Setter Property="Foreground" Value="{DynamicResource BgBase}"/>
|
|
<Setter Property="FontWeight" Value="SemiBold"/>
|
|
</Style>
|
|
<Style Selector="CalendarButton:today /template/ ContentPresenter">
|
|
<Setter Property="Background" Value="{DynamicResource IconBgBlue}"/>
|
|
<Setter Property="Foreground" Value="{DynamicResource AccentBlue}"/>
|
|
<Setter Property="FontWeight" Value="Bold"/>
|
|
</Style>
|
|
|
|
</Styles>
|