feat: Popup BorderBrush.

This commit is contained in:
Zhang Dian 2024-09-30 15:46:37 +08:00
parent aa17c2210d
commit 8cada8c5bb
7 changed files with 30 additions and 24 deletions

View File

@ -7,7 +7,7 @@
<Setter Property="Background" Value="{DynamicResource CalendarBackground}" /> <Setter Property="Background" Value="{DynamicResource CalendarBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource CalendarBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource CalendarBorderBrush}" />
<Setter Property="BorderThickness" Value="{DynamicResource CalendarBorderThickness}" /> <Setter Property="BorderThickness" Value="{DynamicResource CalendarBorderThickness}" />
<Setter Property="Calendar.CornerRadius" Value="{DynamicResource CalendarCornerRadius}" /> <Setter Property="CornerRadius" Value="{DynamicResource CalendarCornerRadius}" />
<Setter Property="HorizontalAlignment" Value="Left" /> <Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Center" /> <Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Template"> <Setter Property="Template">
@ -29,9 +29,9 @@
</ControlTheme> </ControlTheme>
<ControlTheme x:Key="{x:Type CalendarItem}" TargetType="CalendarItem"> <ControlTheme x:Key="{x:Type CalendarItem}" TargetType="CalendarItem">
<Setter Property="CalendarItem.MinWidth" Value="{DynamicResource CalendarMinWidth}" /> <Setter Property="MinWidth" Value="{DynamicResource CalendarMinWidth}" />
<Setter Property="CalendarItem.MinHeight" Value="{DynamicResource CalendarMinHeight}" /> <Setter Property="MinHeight" Value="{DynamicResource CalendarMinHeight}" />
<Setter Property="CalendarItem.DayTitleTemplate"> <Setter Property="DayTitleTemplate">
<Template> <Template>
<TextBlock <TextBlock
HorizontalAlignment="Center" HorizontalAlignment="Center"
@ -43,7 +43,7 @@
</Template> </Template>
</Setter> </Setter>
<Setter Property="CalendarItem.Template"> <Setter Property="Template">
<ControlTemplate TargetType="CalendarItem"> <ControlTemplate TargetType="CalendarItem">
<Border <Border
Padding="16" Padding="16"
@ -144,13 +144,13 @@
<Setter Property="Foreground" Value="{DynamicResource CalendarItemCalendarButtonForeground}" /> <Setter Property="Foreground" Value="{DynamicResource CalendarItemCalendarButtonForeground}" />
<Setter Property="Background" Value="{DynamicResource CalendarItemCalendarButtonBackground}" /> <Setter Property="Background" Value="{DynamicResource CalendarItemCalendarButtonBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource CalendarItemCalendarButtonBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource CalendarItemCalendarButtonBorderBrush}" />
<Setter Property="CalendarButton.CornerRadius" Value="{DynamicResource CalendarItemCalendarButtonCornerRadius}" /> <Setter Property="CornerRadius" Value="{DynamicResource CalendarItemCalendarButtonCornerRadius}" />
<Setter Property="BorderThickness" Value="0" /> <Setter Property="BorderThickness" Value="0" />
<Setter Property="ClipToBounds" Value="False" /> <Setter Property="ClipToBounds" Value="False" />
<Setter Property="CalendarButton.HorizontalContentAlignment" Value="Center" /> <Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="CalendarButton.VerticalContentAlignment" Value="Center" /> <Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="CalendarButton.HorizontalAlignment" Value="Stretch" /> <Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="CalendarButton.VerticalAlignment" Value="Stretch" /> <Setter Property="VerticalAlignment" Value="Stretch" />
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate TargetType="CalendarButton"> <ControlTemplate TargetType="CalendarButton">
<ContentControl <ContentControl

View File

@ -102,7 +102,6 @@
CornerRadius="{DynamicResource CalendarCornerRadius}"> CornerRadius="{DynamicResource CalendarCornerRadius}">
<Calendar <Calendar
Name="PART_Calendar" Name="PART_Calendar"
BorderThickness="0"
CornerRadius="{Binding $parent[Border].CornerRadius}" CornerRadius="{Binding $parent[Border].CornerRadius}"
DisplayDate="{TemplateBinding DisplayDate}" DisplayDate="{TemplateBinding DisplayDate}"
DisplayDateEnd="{TemplateBinding DisplayDateEnd}" DisplayDateEnd="{TemplateBinding DisplayDateEnd}"

View File

@ -8,6 +8,8 @@
<Setter Property="MaxHeight" Value="300" /> <Setter Property="MaxHeight" Value="300" />
<Setter Property="FontWeight" Value="Normal" /> <Setter Property="FontWeight" Value="Normal" />
<Setter Property="Background" Value="{DynamicResource DateTimePickerPopupBackground}" /> <Setter Property="Background" Value="{DynamicResource DateTimePickerPopupBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource DateTimePickerPopupBorderBrush}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="CornerRadius" Value="6" /> <Setter Property="CornerRadius" Value="6" />
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate TargetType="DatePickerPresenter"> <ControlTemplate TargetType="DatePickerPresenter">

View File

@ -8,6 +8,8 @@
<Setter Property="MaxHeight" Value="300" /> <Setter Property="MaxHeight" Value="300" />
<Setter Property="FontWeight" Value="Normal" /> <Setter Property="FontWeight" Value="Normal" />
<Setter Property="Background" Value="{DynamicResource DateTimePickerPopupBackground}" /> <Setter Property="Background" Value="{DynamicResource DateTimePickerPopupBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource DateTimePickerPopupBorderBrush}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="CornerRadius" Value="6" /> <Setter Property="CornerRadius" Value="6" />
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate TargetType="TimePickerPresenter"> <ControlTemplate TargetType="TimePickerPresenter">

View File

@ -1,6 +1,7 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="DateTimePickerListItemBackground" Color="Transparent" /> <SolidColorBrush x:Key="DateTimePickerListItemBackground" Color="Transparent" />
<SolidColorBrush x:Key="DateTimePickerPopupBackground" Color="#43444A" /> <SolidColorBrush x:Key="DateTimePickerPopupBackground" Color="#43444A" />
<SolidColorBrush x:Key="DateTimePickerPopupBorderBrush" Color="Transparent" />
<SolidColorBrush x:Key="DateTimePickerFlyoutButtonForeground" Opacity="0.6" Color="#F9F9F9" /> <SolidColorBrush x:Key="DateTimePickerFlyoutButtonForeground" Opacity="0.6" Color="#F9F9F9" />
<SolidColorBrush x:Key="DateTimePickerFlyoutButtonPointeroverForeground" Color="#F9F9F9" /> <SolidColorBrush x:Key="DateTimePickerFlyoutButtonPointeroverForeground" Color="#F9F9F9" />
<SolidColorBrush x:Key="DateTimePickerFlyoutButtonPressedForeground" Color="#F9F9F9" /> <SolidColorBrush x:Key="DateTimePickerFlyoutButtonPressedForeground" Color="#F9F9F9" />

View File

@ -74,10 +74,10 @@
<SolidColorBrush x:Key="CalendarItemCalendarButtonBackground" Color="{StaticResource WindowColor}" /> <SolidColorBrush x:Key="CalendarItemCalendarButtonBackground" Color="{StaticResource WindowColor}" />
<SolidColorBrush x:Key="CalendarItemCalendarButtonForeground" Color="{StaticResource WindowTextColor}" /> <SolidColorBrush x:Key="CalendarItemCalendarButtonForeground" Color="{StaticResource WindowTextColor}" />
<SolidColorBrush x:Key="CalendarItemCalendarButtonBorderBrush" Color="Transparent" /> <SolidColorBrush x:Key="CalendarItemCalendarButtonBorderBrush" Color="Transparent" />
<SolidColorBrush x:Key="CalendarItemCalendarButtonPointeroverBackground" Color="{StaticResource WindowColor}" /> <SolidColorBrush x:Key="CalendarItemCalendarButtonPointeroverBackground" Color="{StaticResource HighlightTextColor}" />
<SolidColorBrush x:Key="CalendarItemCalendarButtonPressedBackground" Color="{StaticResource WindowColor}" /> <SolidColorBrush x:Key="CalendarItemCalendarButtonPressedBackground" Color="{StaticResource HighlightTextColor}" />
<SolidColorBrush x:Key="CalendarItemCalendarButtonSelectedBackground" Color="{StaticResource WindowColor}" /> <SolidColorBrush x:Key="CalendarItemCalendarButtonSelectedBackground" Color="{StaticResource HighlightColor}" />
<SolidColorBrush x:Key="CalendarItemCalendarButtonSelectedForeground" Color="{StaticResource HotlightColor}" /> <SolidColorBrush x:Key="CalendarItemCalendarButtonSelectedForeground" Color="{StaticResource HighlightTextColor}" />
<SolidColorBrush x:Key="CalendarItemCalendarButtonDisabledForeground" Color="{StaticResource GrayTextColor}" /> <SolidColorBrush x:Key="CalendarItemCalendarButtonDisabledForeground" Color="{StaticResource GrayTextColor}" />
<SolidColorBrush x:Key="CalendarItemCalendarButtonBlackoutForeground" Color="{StaticResource GrayTextColor}" /> <SolidColorBrush x:Key="CalendarItemCalendarButtonBlackoutForeground" Color="{StaticResource GrayTextColor}" />
<SolidColorBrush x:Key="CalendarItemCalendarButtonInactiveForeground" Color="{StaticResource GrayTextColor}" /> <SolidColorBrush x:Key="CalendarItemCalendarButtonInactiveForeground" Color="{StaticResource GrayTextColor}" />
@ -86,14 +86,14 @@
<SolidColorBrush x:Key="CalendarItemCalendarDayButtonBackground" Color="{StaticResource WindowColor}" /> <SolidColorBrush x:Key="CalendarItemCalendarDayButtonBackground" Color="{StaticResource WindowColor}" />
<SolidColorBrush x:Key="CalendarItemCalendarDayButtonBorderBrush" Color="Transparent" /> <SolidColorBrush x:Key="CalendarItemCalendarDayButtonBorderBrush" Color="Transparent" />
<SolidColorBrush x:Key="CalendarItemCalendarDayButtonPointeroverBackground" Color="{StaticResource WindowColor}" /> <SolidColorBrush x:Key="CalendarItemCalendarDayButtonPointeroverBackground" Color="{StaticResource HighlightTextColor}" />
<SolidColorBrush x:Key="CalendarItemCalendarDayButtonPressedBackground" Color="{StaticResource WindowColor}" /> <SolidColorBrush x:Key="CalendarItemCalendarDayButtonPressedBackground" Color="{StaticResource HighlightTextColor}" />
<SolidColorBrush x:Key="CalendarItemCalendarDayButtonSelectedBackground" Color="{StaticResource WindowColor}" /> <SolidColorBrush x:Key="CalendarItemCalendarDayButtonSelectedBackground" Color="{StaticResource HighlightColor}" />
<SolidColorBrush x:Key="CalendarItemCalendarDayButtonSelectedForeground" Color="{StaticResource HotlightColor}" /> <SolidColorBrush x:Key="CalendarItemCalendarDayButtonSelectedForeground" Color="{StaticResource HighlightTextColor}" />
<SolidColorBrush x:Key="CalendarItemCalendarDayButtonTodayForeground" Color="{StaticResource HighlightTextColor}" /> <SolidColorBrush x:Key="CalendarItemCalendarDayButtonTodayForeground" Color="{StaticResource HighlightColor}" />
<SolidColorBrush x:Key="CalendarItemCalendarDayButtonTodayBackground" Color="{StaticResource HighlightColor}" /> <SolidColorBrush x:Key="CalendarItemCalendarDayButtonTodayBackground" Color="{StaticResource HighlightTextColor}" />
<SolidColorBrush x:Key="CalendarItemCalendarDayButtonDisabledForeground" Color="{StaticResource GrayTextColor}" /> <SolidColorBrush x:Key="CalendarItemCalendarDayButtonDisabledForeground" Color="{StaticResource GrayTextColor}" />
<SolidColorBrush x:Key="CalendarItemCalendarDayButtonBlackoutForeground" Color="{StaticResource GrayTextColor}" /> <SolidColorBrush x:Key="CalendarItemCalendarDayButtonBlackoutForeground" Color="{StaticResource GrayTextColor}" />
@ -194,12 +194,13 @@
<!-- DateTimePickerShared --> <!-- DateTimePickerShared -->
<SolidColorBrush x:Key="DateTimePickerListItemBackground" Color="{StaticResource WindowColor}" /> <SolidColorBrush x:Key="DateTimePickerListItemBackground" Color="{StaticResource WindowColor}" />
<SolidColorBrush x:Key="DateTimePickerPopupBackground" Color="{StaticResource WindowColor}" /> <SolidColorBrush x:Key="DateTimePickerPopupBackground" Color="{StaticResource WindowColor}" />
<SolidColorBrush x:Key="DateTimePickerPopupBorderBrush" Color="{StaticResource WindowTextColor}" />
<SolidColorBrush x:Key="DateTimePickerFlyoutButtonForeground" Color="{StaticResource WindowTextColor}" /> <SolidColorBrush x:Key="DateTimePickerFlyoutButtonForeground" Color="{StaticResource WindowTextColor}" />
<SolidColorBrush x:Key="DateTimePickerFlyoutButtonPointeroverForeground" Color="{StaticResource HotlightColor}" /> <SolidColorBrush x:Key="DateTimePickerFlyoutButtonPointeroverForeground" Color="{StaticResource HighlightColor}" />
<SolidColorBrush x:Key="DateTimePickerFlyoutButtonPressedForeground" Color="{StaticResource HotlightColor}" /> <SolidColorBrush x:Key="DateTimePickerFlyoutButtonPressedForeground" Color="{StaticResource HighlightColor}" />
<SolidColorBrush x:Key="DateTimePickerFlyoutButtonBackground" Color="{StaticResource WindowColor}" /> <SolidColorBrush x:Key="DateTimePickerFlyoutButtonBackground" Color="{StaticResource WindowColor}" />
<SolidColorBrush x:Key="DateTimePickerFlyoutButtonPointeroverBackground" Color="{StaticResource WindowColor}" /> <SolidColorBrush x:Key="DateTimePickerFlyoutButtonPointeroverBackground" Color="{StaticResource HighlightTextColor}" />
<SolidColorBrush x:Key="DateTimePickerFlyoutButtonPressedBackground" Color="{StaticResource WindowColor}" /> <SolidColorBrush x:Key="DateTimePickerFlyoutButtonPressedBackground" Color="{StaticResource WindowColor}" />
<SolidColorBrush x:Key="DateTimePickerSeparatorBackground" Color="{StaticResource WindowTextColor}" /> <SolidColorBrush x:Key="DateTimePickerSeparatorBackground" Color="{StaticResource WindowTextColor}" />

View File

@ -3,6 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="DateTimePickerListItemBackground" Color="Transparent" /> <SolidColorBrush x:Key="DateTimePickerListItemBackground" Color="Transparent" />
<SolidColorBrush x:Key="DateTimePickerPopupBackground" Color="White" /> <SolidColorBrush x:Key="DateTimePickerPopupBackground" Color="White" />
<SolidColorBrush x:Key="DateTimePickerPopupBorderBrush" Color="Transparent" />
<SolidColorBrush x:Key="DateTimePickerFlyoutButtonForeground" Opacity="0.62" Color="#1C1F23" /> <SolidColorBrush x:Key="DateTimePickerFlyoutButtonForeground" Opacity="0.62" Color="#1C1F23" />
<SolidColorBrush x:Key="DateTimePickerFlyoutButtonPointeroverForeground" Color="#1C1F23" /> <SolidColorBrush x:Key="DateTimePickerFlyoutButtonPointeroverForeground" Color="#1C1F23" />
<SolidColorBrush x:Key="DateTimePickerFlyoutButtonPressedForeground" Color="#1C1F23" /> <SolidColorBrush x:Key="DateTimePickerFlyoutButtonPressedForeground" Color="#1C1F23" />