Browse Source

Fluent: CheckBox should respect Background and BorderBrush

pull/4777/head
Max Katz 6 years ago
parent
commit
4b4d9816f9
  1. 18
      src/Avalonia.Themes.Fluent/CheckBox.xaml

18
src/Avalonia.Themes.Fluent/CheckBox.xaml

@ -5,8 +5,6 @@
</Border> </Border>
</Design.PreviewWith> </Design.PreviewWith>
<Style Selector="CheckBox"> <Style Selector="CheckBox">
<Setter Property="Background" Value="{DynamicResource CheckBoxBackgroundUnchecked}" />
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxBorderBrushUnchecked}" />
<Setter Property="Padding" Value="8,0,0,0" /> <Setter Property="Padding" Value="8,0,0,0" />
<Setter Property="HorizontalAlignment" Value="Left" /> <Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Center" /> <Setter Property="VerticalAlignment" Value="Center" />
@ -20,10 +18,12 @@
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate> <ControlTemplate>
<Grid x:Name="RootGrid" ColumnDefinitions="20,*"> <Grid x:Name="RootGrid" ColumnDefinitions="20,*">
<Border x:Name="PART_Border" Background="{TemplateBinding Background}" <Border x:Name="PART_Border"
BorderBrush="{TemplateBinding BorderBrush}" Grid.ColumnSpan="2"
BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}"
CornerRadius="{DynamicResource ControlCornerRadius}" /> BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{DynamicResource ControlCornerRadius}" />
<Grid VerticalAlignment="Top" Height="32"> <Grid VerticalAlignment="Top" Height="32">
<Border x:Name="NormalRectangle" <Border x:Name="NormalRectangle"
@ -58,7 +58,7 @@
<Setter Property="Foreground" Value="{DynamicResource CheckBoxForegroundUnchecked}" /> <Setter Property="Foreground" Value="{DynamicResource CheckBoxForegroundUnchecked}" />
</Style> </Style>
<Style Selector="CheckBox /template/ Border#PART_Border"> <Style Selector="CheckBox">
<Setter Property="Background" Value="{DynamicResource CheckBoxBackgroundUnchecked}" /> <Setter Property="Background" Value="{DynamicResource CheckBoxBackgroundUnchecked}" />
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxBorderBrushUnchecked}" /> <Setter Property="BorderBrush" Value="{DynamicResource CheckBoxBorderBrushUnchecked}" />
</Style> </Style>
@ -136,7 +136,7 @@
<Setter Property="Foreground" Value="{DynamicResource CheckBoxForegroundChecked}" /> <Setter Property="Foreground" Value="{DynamicResource CheckBoxForegroundChecked}" />
</Style> </Style>
<Style Selector="CheckBox:checked /template/ Border#PART_Border"> <Style Selector="CheckBox:checked">
<Setter Property="Background" Value="{DynamicResource CheckBoxBackgroundChecked}" /> <Setter Property="Background" Value="{DynamicResource CheckBoxBackgroundChecked}" />
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxBorderBrushChecked}" /> <Setter Property="BorderBrush" Value="{DynamicResource CheckBoxBorderBrushChecked}" />
</Style> </Style>
@ -216,7 +216,7 @@
<Setter Property="Foreground" Value="{DynamicResource CheckBoxForegroundIndeterminate}" /> <Setter Property="Foreground" Value="{DynamicResource CheckBoxForegroundIndeterminate}" />
</Style> </Style>
<Style Selector="CheckBox:indeterminate /template/ Border#PART_Border"> <Style Selector="CheckBox:indeterminate">
<Setter Property="Background" Value="{DynamicResource CheckBoxBackgroundIndeterminate}" /> <Setter Property="Background" Value="{DynamicResource CheckBoxBackgroundIndeterminate}" />
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxBorderBrushIndeterminate}" /> <Setter Property="BorderBrush" Value="{DynamicResource CheckBoxBorderBrushIndeterminate}" />
</Style> </Style>

Loading…
Cancel
Save