Browse Source

Merge pull request #1874 from wdcossey/CheckBox-Restyle-08-09-2018

CheckBox restyle
Steven Kirk 7 years ago
parent
commit
5f27733ee3
1 changed files with 8 additions and 2 deletions
  1. 8 2
      src/Avalonia.Themes.Default/CheckBox.xaml

+ 8 - 2
src/Avalonia.Themes.Default/CheckBox.xaml

@@ -1,12 +1,16 @@
 <Styles xmlns="https://github.com/avaloniaui">
   <Style Selector="CheckBox">
+    <Setter Property="Foreground" Value="{DynamicResource ThemeForegroundBrush}"/>
     <Setter Property="Background" Value="Transparent"/>
     <Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderMidBrush}"/>
     <Setter Property="BorderThickness" Value="{DynamicResource ThemeBorderThickness}"/>
+    <Setter Property="VerticalContentAlignment" Value="Center"/>
+    <Setter Property="HorizontalContentAlignment" Value="Left"/>
     <Setter Property="Template">
       <ControlTemplate>
-        <Grid ColumnDefinitions="Auto,*" Background="{TemplateBinding Background}">
+        <Grid ColumnDefinitions="Auto,*">
           <Border Name="border"
+                  Background="{TemplateBinding Background}"
                   BorderBrush="{TemplateBinding BorderBrush}"
                   BorderThickness="{TemplateBinding BorderThickness}"
                   Width="18"
@@ -31,10 +35,12 @@
             </Panel>
           </Border>
           <ContentPresenter Name="PART_ContentPresenter"
+                            TextBlock.Foreground="{TemplateBinding Foreground}"
                             ContentTemplate="{TemplateBinding ContentTemplate}"
                             Content="{TemplateBinding Content}"
                             Margin="4,0,0,0"
-                            VerticalAlignment="Center"
+                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
+                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                             Grid.Column="1"/>
         </Grid>
       </ControlTemplate>