Browse Source

Introduced resources to be able to properly resize Checkbox and RadioButton in the Compact density of the Fluent theme. (#19882)

release/11.3.8
Michal Rezny 4 months ago
committed by Julien Lebosquain
parent
commit
0817fa2277
  1. 5
      src/Avalonia.Themes.Fluent/Controls/CheckBox.xaml
  2. 4
      src/Avalonia.Themes.Fluent/Controls/RadioButton.xaml
  3. 2
      src/Avalonia.Themes.Fluent/DensityStyles/Compact.xaml

5
src/Avalonia.Themes.Fluent/Controls/CheckBox.xaml

@ -13,6 +13,7 @@
</Design.PreviewWith>
<StreamGeometry x:Key="CheckMarkPathData">M5.5 10.586 1.707 6.793A1 1 0 0 0 .293 8.207l4.5 4.5a1 1 0 0 0 1.414 0l11-11A1 1 0 0 0 15.793.293L5.5 10.586Z</StreamGeometry>
<x:Double x:Key="CheckBoxMinHeight">32</x:Double>
<ControlTheme x:Key="{x:Type CheckBox}" TargetType="CheckBox">
<Setter Property="Padding" Value="8,0,0,0" />
@ -21,7 +22,7 @@
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
<Setter Property="MinHeight" Value="32" />
<Setter Property="MinHeight" Value="{DynamicResource CheckBoxMinHeight}" />
<Setter Property="Foreground" Value="{DynamicResource CheckBoxForegroundUnchecked}" />
<Setter Property="Background" Value="{DynamicResource CheckBoxBackgroundUnchecked}" />
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxBorderBrushUnchecked}" />
@ -35,7 +36,7 @@
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}" />
<Grid VerticalAlignment="Top" Height="32">
<Grid VerticalAlignment="Top" Height="{DynamicResource CheckBoxMinHeight}">
<Border x:Name="NormalRectangle"
BorderBrush="{DynamicResource CheckBoxCheckBackgroundStrokeUnchecked}"
Background="{DynamicResource CheckBoxCheckBackgroundFillUnchecked}"

4
src/Avalonia.Themes.Fluent/Controls/RadioButton.xaml

@ -11,6 +11,8 @@
</Border>
</Design.PreviewWith>
<x:Double x:Key="RadioButtonMinHeight">32</x:Double>
<ControlTheme x:Key="{x:Type RadioButton}" TargetType="RadioButton">
<Setter Property="Background" Value="{DynamicResource RadioButtonBackground}" />
<Setter Property="Foreground" Value="{DynamicResource RadioButtonForeground}" />
@ -30,7 +32,7 @@
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}">
<Grid ColumnDefinitions="20,*">
<Grid Height="32" VerticalAlignment="Top">
<Grid Height="{DynamicResource RadioButtonMinHeight}" VerticalAlignment="Top">
<Ellipse
Name="OuterEllipse"

2
src/Avalonia.Themes.Fluent/DensityStyles/Compact.xaml

@ -21,4 +21,6 @@
<x:Double x:Key="TabItemMinHeight">28</x:Double>
<Thickness x:Key="TabItemHeaderMargin">6, 0</Thickness>
<Thickness x:Key="ButtonPadding">6,4</Thickness>
<x:Double x:Key="CheckBoxMinHeight">24</x:Double>
<x:Double x:Key="RadioButtonMinHeight">24</x:Double>
</ResourceDictionary>

Loading…
Cancel
Save