fix: fix radiobutton vertical alignment.

This commit is contained in:
rabbitism 2023-03-28 21:59:42 +08:00
parent 6cafdd6e1c
commit 4db7bbf522

View File

@ -35,7 +35,7 @@
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}">
<Grid ColumnDefinitions="Auto,*">
<Grid Margin="{DynamicResource RadioButtonIconMargin}" VerticalAlignment="Top">
<Grid Margin="{DynamicResource RadioButtonIconMargin}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
<Ellipse
Name="OuterEllipse"
Width="{DynamicResource RadioButtonIconRadius}"
@ -169,6 +169,7 @@
<ControlTheme x:Key="ButtonRadioButton" TargetType="RadioButton">
<Setter Property="RadioButton.CornerRadius" Value="{DynamicResource RadioButtonButtonCornerRadius}" />
<Setter Property="RadioButton.VerticalContentAlignment" Value="Center" />
<Setter Property="RadioButton.Margin" Value="2" />
<Setter Property="RadioButton.Cursor" Value="Hand" />
<Setter Property="RadioButton.FontWeight" Value="{DynamicResource RadioButtonButtonFontWeight}" />
@ -227,7 +228,7 @@
<Setter Property="RadioButton.CornerRadius" Value="{DynamicResource RadioButtonCardCornerRadius}" />
<Setter Property="RadioButton.Cursor" Value="Hand" />
<Setter Property="RadioButton.HorizontalAlignment" Value="Left" />
<Setter Property="RadioButton.VerticalAlignment" Value="Top" />
<Setter Property="RadioButton.VerticalAlignment" Value="Center" />
<Setter Property="RadioButton.HorizontalContentAlignment" Value="Left" />
<Setter Property="RadioButton.VerticalContentAlignment" Value="Center" />
<Setter Property="RadioButton.Background" Value="{DynamicResource RadioButtonCardDefaultBackground}" />
@ -242,7 +243,10 @@
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}">
<Grid ColumnDefinitions="Auto,*">
<Grid
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
ColumnDefinitions="Auto,*">
<Grid Margin="{DynamicResource RadioButtonIconMargin}" VerticalAlignment="Top">
<Ellipse
Name="OuterEllipse"
@ -267,7 +271,6 @@
<ContentPresenter
Name="PART_ContentPresenter"
Grid.Column="1"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
@ -390,6 +393,7 @@
<ControlTheme x:Key="PureCardRadioButton" TargetType="RadioButton">
<Setter Property="RadioButton.CornerRadius" Value="{DynamicResource RadioButtonCardCornerRadius}" />
<Setter Property="RadioButton.Cursor" Value="Hand" />
<Setter Property="RadioButton.VerticalContentAlignment" Value="Center" />
<Setter Property="RadioButton.BorderThickness" Value="1" />
<Setter Property="RadioButton.FontSize" Value="{DynamicResource RadioButtonFontSize}" />
<Setter Property="RadioButton.Padding" Value="{DynamicResource RadioButtonCardPadding}" />