Browse Source

Set background for CheckBox and RadioButton

Now we have mouse transparency with the deferred renderer, we need to make sure there's a transparent background to make them hittable.
Steven Kirk 8 years ago
parent
commit
1cb2e321d2

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

@@ -1,10 +1,11 @@
 <Styles xmlns="https://github.com/avaloniaui">
   <Style Selector="CheckBox">
+    <Setter Property="Background" Value="Transparent"/>
     <Setter Property="BorderBrush" Value="{StyleResource ThemeBorderMidBrush}"/>
     <Setter Property="BorderThickness" Value="{StyleResource ThemeBorderThickness}"/>
     <Setter Property="Template">
       <ControlTemplate>
-        <Grid ColumnDefinitions="Auto,*">
+        <Grid ColumnDefinitions="Auto,*" Background="{TemplateBinding Background}">
           <Border Name="border"
                   BorderBrush="{TemplateBinding BorderBrush}"
                   BorderThickness="{TemplateBinding BorderThickness}"

+ 2 - 1
src/Avalonia.Themes.Default/RadioButton.xaml

@@ -1,10 +1,11 @@
 <Styles xmlns="https://github.com/avaloniaui">
   <Style Selector="RadioButton">
+    <Setter Property="Background" Value="Transparent"/>
     <Setter Property="BorderBrush" Value="{StyleResource ThemeBorderMidBrush}"/>
     <Setter Property="BorderThickness" Value="{StyleResource ThemeBorderThickness}"/>
     <Setter Property="Template">
       <ControlTemplate>
-        <Grid ColumnDefinitions="Auto,*">
+        <Grid ColumnDefinitions="Auto,*" Background="{TemplateBinding Background}">
           <Ellipse Name="border"
                    Stroke="{TemplateBinding BorderBrush}"
                    StrokeThickness="{TemplateBinding BorderThickness}"