feat: replace discrete Icon Size.

This commit is contained in:
Zhang Dian
2025-03-06 23:35:31 +08:00
parent 42233d272c
commit 30f39d1383
8 changed files with 38 additions and 32 deletions

View File

@@ -272,8 +272,8 @@
</ControlTheme>
<ControlTheme x:Key="InnerIconButton" TargetType="Button">
<Setter Property="Width" Value="16" />
<Setter Property="Height" Value="16" />
<Setter Property="Width" Value="{DynamicResource SemiWidthIconMedium}" />
<Setter Property="Height" Value="{DynamicResource SemiWidthIconMedium}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonInputInnerForeground}" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Cursor" Value="Hand" />

View File

@@ -2,6 +2,11 @@
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:CompileBindings="True">
<Design.PreviewWith>
<Border Padding="20">
<DatePickerPresenter />
</Border>
</Design.PreviewWith>
<ControlTheme x:Key="{x:Type DatePickerPresenter}" TargetType="DatePickerPresenter">
<Setter Property="Width" Value="296" />
<Setter Property="MinWidth" Value="296" />
@@ -91,8 +96,7 @@
VerticalAlignment="Stretch"
Theme="{StaticResource DateTimePickerButton}">
<PathIcon
Width="12"
Height="12"
Theme="{StaticResource InnerPathIcon}"
Data="{DynamicResource DateTimePickerAcceptGlyph}" />
</Button>
<Rectangle
@@ -106,8 +110,7 @@
VerticalAlignment="Stretch"
Theme="{StaticResource DateTimePickerButton}">
<PathIcon
Width="12"
Height="12"
Theme="{StaticResource InnerPathIcon}"
Data="{DynamicResource DateTimePickerDismissGlyph}" />
</Button>
<Rectangle

View File

@@ -115,8 +115,8 @@
<Setter Property="Content">
<Template>
<PathIcon
Width="8"
Height="8"
Theme="{StaticResource InnerPathIcon}"
Classes="ExtraSmall"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="{DynamicResource DateTimePickerButtonUpGlyph}" />
@@ -136,8 +136,8 @@
<Setter Property="Content">
<Template>
<PathIcon
Width="8"
Height="8"
Theme="{StaticResource InnerPathIcon}"
Classes="ExtraSmall"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="{DynamicResource DateTimePickerButtonDownGlyph}" />

View File

@@ -37,8 +37,8 @@
</MultiBinding>
</RepeatButton.IsVisible>
<PathIcon
Width="8"
Height="8"
Theme="{StaticResource InnerPathIcon}"
Classes="ExtraSmall"
Data="{DynamicResource MenuScrollViewerUpButtonGlyph}"
Foreground="{DynamicResource MenuFlyoutScrollViewerIconForeground}" />
</RepeatButton>
@@ -63,8 +63,8 @@
</MultiBinding>
</RepeatButton.IsVisible>
<PathIcon
Width="8"
Height="8"
Theme="{StaticResource InnerPathIcon}"
Classes="ExtraSmall"
Data="{DynamicResource MenuScrollViewerDownButtonGlyph}"
Foreground="{DynamicResource MenuFlyoutScrollViewerIconForeground}" />
</RepeatButton>

View File

@@ -25,8 +25,8 @@
</ControlTheme>
<ControlTheme x:Key="InnerPathIcon" TargetType="PathIcon">
<Setter Property="Height" Value="16" />
<Setter Property="Width" Value="16" />
<Setter Property="Width" Value="{StaticResource SemiWidthIconMedium}" />
<Setter Property="Height" Value="{StaticResource SemiWidthIconMedium}" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Template">
<ControlTemplate TargetType="PathIcon">
@@ -48,20 +48,20 @@
<Setter Property="Fill" Value="{TemplateBinding BorderBrush}" />
</Style>
<Style Selector="^.ExtraSmall">
<Setter Property="Height" Value="8" />
<Setter Property="Width" Value="8" />
<Setter Property="Width" Value="{StaticResource SemiWidthIconExtraSmall}" />
<Setter Property="Height" Value="{StaticResource SemiWidthIconExtraSmall}" />
</Style>
<Style Selector="^.Small">
<Setter Property="Height" Value="12" />
<Setter Property="Width" Value="12" />
<Setter Property="Width" Value="{StaticResource SemiWidthIconSmall}" />
<Setter Property="Height" Value="{StaticResource SemiWidthIconSmall}" />
</Style>
<Style Selector="^.Large">
<Setter Property="Height" Value="20" />
<Setter Property="Width" Value="20" />
<Setter Property="Width" Value="{StaticResource SemiWidthIconLarge}" />
<Setter Property="Height" Value="{StaticResource SemiWidthIconLarge}" />
</Style>
<Style Selector="^.ExtraLarge">
<Setter Property="Height" Value="24" />
<Setter Property="Width" Value="24" />
<Setter Property="Width" Value="{StaticResource SemiWidthIconExtraLarge}" />
<Setter Property="Height" Value="{StaticResource SemiWidthIconExtraLarge}" />
</Style>
</ControlTheme>
</ResourceDictionary>

View File

@@ -2,6 +2,11 @@
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:CompileBindings="True">
<Design.PreviewWith>
<Border Padding="20">
<TimePickerPresenter />
</Border>
</Design.PreviewWith>
<ControlTheme x:Key="{x:Type TimePickerPresenter}" TargetType="TimePickerPresenter">
<Setter Property="Width" Value="242" />
<Setter Property="MinWidth" Value="242" />
@@ -112,8 +117,7 @@
VerticalAlignment="Stretch"
Theme="{StaticResource DateTimePickerButton}">
<PathIcon
Width="12"
Height="12"
Theme="{StaticResource InnerPathIcon}"
Data="{DynamicResource DateTimePickerAcceptGlyph}" />
</Button>
<Rectangle
@@ -127,8 +131,7 @@
VerticalAlignment="Stretch"
Theme="{StaticResource DateTimePickerButton}">
<PathIcon
Width="12"
Height="12"
Theme="{StaticResource InnerPathIcon}"
Data="{DynamicResource DateTimePickerDismissGlyph}" />
</Button>
<Rectangle

View File

@@ -1,6 +1,6 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StaticResource x:Key="DateTimePickerButtonUpGlyph" ResourceKey="SemiIconCaretUp" />
<StaticResource x:Key="DateTimePickerButtonDownGlyph" ResourceKey="SemiIconCaretDown" />
<StaticResource x:Key="DateTimePickerButtonUpGlyph" ResourceKey="SemiIconTriangleUp" />
<StaticResource x:Key="DateTimePickerButtonDownGlyph" ResourceKey="SemiIconTriangleDown" />
<StaticResource x:Key="DateTimePickerAcceptGlyph" ResourceKey="SemiIconTick" />
<StaticResource x:Key="DateTimePickerDismissGlyph" ResourceKey="SemiIconClose" />
<StaticResource x:Key="DateTimePickerPopupCornerRadius" ResourceKey="SemiBorderRadiusMedium" />

View File

@@ -1,6 +1,6 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StaticResource x:Key="MenuScrollViewerUpButtonGlyph" ResourceKey="SemiIconCaretUp" />
<StaticResource x:Key="MenuScrollViewerDownButtonGlyph" ResourceKey="SemiIconCaretDown" />
<StaticResource x:Key="MenuScrollViewerUpButtonGlyph" ResourceKey="SemiIconTriangleUp" />
<StaticResource x:Key="MenuScrollViewerDownButtonGlyph" ResourceKey="SemiIconTriangleDown" />
<StaticResource x:Key="MenuItemExpandIconGlyph" ResourceKey="SemiIconChevronRight" />
<StaticResource x:Key="MenuCheckGlyph" ResourceKey="SemiIconTick" />
<!-- MenuFlyout -->