Merge pull request #162 from irihitech/150-radiobutton
RadioButton and CheckBox alignment issue
This commit is contained in:
commit
0af182680f
@ -180,6 +180,7 @@
|
||||
|
||||
<ControlTheme x:Key="CardCheckBox" TargetType="CheckBox">
|
||||
<Setter Property="Cursor" Value="Hand" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="Padding" Value="{DynamicResource CheckBoxCardPadding}" />
|
||||
<Setter Property="BorderThickness" Value="{DynamicResource CheckBoxCardBorderThickness}" />
|
||||
<Setter Property="CornerRadius" Value="{DynamicResource CheckBoxCardCornerRadius}" />
|
||||
@ -193,7 +194,11 @@
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}">
|
||||
<Grid x:Name="RootGrid" ColumnDefinitions="Auto,*">
|
||||
<Grid
|
||||
x:Name="RootGrid"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
ColumnDefinitions="Auto,*">
|
||||
<Grid Grid.Column="0" VerticalAlignment="Top">
|
||||
<Border
|
||||
x:Name="NormalRectangle"
|
||||
@ -215,7 +220,6 @@
|
||||
x:Name="ContentPresenter"
|
||||
Grid.Column="1"
|
||||
Margin="8,0,0,0"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="Center"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
@ -376,87 +380,82 @@
|
||||
<Setter Property="Padding" Value="{DynamicResource CheckBoxCardPadding}" />
|
||||
<Setter Property="BorderThickness" Value="{DynamicResource CheckBoxCardBorderThickness}" />
|
||||
<Setter Property="CornerRadius" Value="{DynamicResource CheckBoxCardCornerRadius}" />
|
||||
<Setter Property="CheckBox.VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="CheckBox.Template">
|
||||
<ControlTemplate TargetType="CheckBox">
|
||||
<Border
|
||||
Name="RootBorder"
|
||||
<ContentPresenter
|
||||
x:Name="PART_ContentPresenter"
|
||||
Margin="{TemplateBinding Margin}"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}">
|
||||
<ContentPresenter
|
||||
x:Name="ContentPresenter"
|
||||
Grid.Column="1"
|
||||
Margin="8,0,0,0"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="Center"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
IsVisible="{TemplateBinding Content,
|
||||
Converter={x:Static ObjectConverters.IsNotNull}}"
|
||||
RecognizesAccessKey="True"
|
||||
TextWrapping="Wrap" />
|
||||
</Border>
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
RecognizesAccessKey="True"
|
||||
UseLayoutRounding="False" />
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
<!-- Unchecked Pointerover State -->
|
||||
<Style Selector="^:pointerover">
|
||||
<Style Selector="^ /template/ Border#RootBorder">
|
||||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="Background" Value="{DynamicResource CheckBoxCardPointeroverBackground}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<!-- Unchecked Pressed State -->
|
||||
<Style Selector="^:pressed">
|
||||
<Style Selector="^ /template/ Border#RootBorder">
|
||||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="Background" Value="{DynamicResource CheckBoxCardPressedBackground}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<!-- Unchecked Disabled state -->
|
||||
<Style Selector="^:disabled">
|
||||
<Style Selector="^ /template/ ContentPresenter#ContentPresenter">
|
||||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="Foreground" Value="{DynamicResource CheckBoxDisabledForeground}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:checked">
|
||||
<Style Selector="^ /template/ Border#RootBorder">
|
||||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCardCheckedBorderBrush}" />
|
||||
<Setter Property="Background" Value="{DynamicResource CheckBoxCardCheckedBackground}" />
|
||||
</Style>
|
||||
<Style Selector="^:pointerover /template/ Border#RootBorder">
|
||||
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCardCheckedPointeroverBorderBrush}" />
|
||||
</Style>
|
||||
<Style Selector="^:pressed /template/ Border#RootBorder">
|
||||
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCardCheckedPressedBorderBrush}" />
|
||||
</Style>
|
||||
<!-- Checked Disabled State -->
|
||||
<Style Selector="^:disabled">
|
||||
<Style Selector="^ /template/ Border#RootBorder">
|
||||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCardCheckedDisabledBorderBrush}" />
|
||||
</Style>
|
||||
<Style Selector="^ /template/ ContentPresenter#ContentPresenter">
|
||||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="Foreground" Value="{DynamicResource CheckBoxDisabledForeground}" />
|
||||
</Style>
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:indeterminate">
|
||||
<Style Selector="^ /template/ Border#RootBorder">
|
||||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCardCheckedBorderBrush}" />
|
||||
</Style>
|
||||
<Style Selector="^:pointerover /template/ Border#RootBorder">
|
||||
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCardCheckedPointeroverBorderBrush}" />
|
||||
</Style>
|
||||
<Style Selector="^:pressed /template/ Border#RootBorder">
|
||||
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCardCheckedPressedBorderBrush}" />
|
||||
</Style>
|
||||
<Style Selector="^:disabled">
|
||||
<Style Selector="^ /template/ Border#RootBorder">
|
||||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCardCheckedDisabledBorderBrush}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
@ -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,10 +393,10 @@
|
||||
<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}" />
|
||||
<Setter Property="RadioButton.Foreground" Value="{DynamicResource RadioButtonButtonUncheckedForeground}" />
|
||||
<Setter Property="RadioButton.Background" Value="{DynamicResource RadioButtonCardDefaultBackground}" />
|
||||
<Setter Property="RadioButton.Template">
|
||||
<ControlTemplate TargetType="RadioButton">
|
||||
@ -410,8 +413,6 @@
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
RecognizesAccessKey="True"
|
||||
TextElement.FontSize="{TemplateBinding FontSize}"
|
||||
TextElement.FontWeight="{TemplateBinding FontWeight}"
|
||||
UseLayoutRounding="False" />
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
Loading…
x
Reference in New Issue
Block a user