Browse Source

Use thickness instead of width and height

Wiesław Šoltés 7 years ago
parent
commit
338fe1d5eb

+ 1 - 2
src/Avalonia.Themes.Default/Accents/BaseDark.xaml

@@ -53,7 +53,6 @@
         <sys:Double x:Key="FontSizeNormal">12</sys:Double>
         <sys:Double x:Key="FontSizeLarge">16</sys:Double>
 
-        <sys:Double x:Key="ScrollBarWidth">10</sys:Double>
-        <sys:Double x:Key="ScrollBarHeight">10</sys:Double>
+        <sys:Double x:Key="ScrollBarThickness">10</sys:Double>
     </Style.Resources>
 </Style>

+ 1 - 2
src/Avalonia.Themes.Default/Accents/BaseLight.xaml

@@ -53,7 +53,6 @@
         <sys:Double x:Key="FontSizeNormal">12</sys:Double>
         <sys:Double x:Key="FontSizeLarge">16</sys:Double>
 
-        <sys:Double x:Key="ScrollBarWidth">10</sys:Double>
-        <sys:Double x:Key="ScrollBarHeight">10</sys:Double>
+        <sys:Double x:Key="ScrollBarThickness">10</sys:Double>
     </Style.Resources>
 </Style>

+ 4 - 4
src/Avalonia.Themes.Default/ScrollBar.xaml

@@ -53,7 +53,7 @@
         </Setter>
     </Style>
     <Style Selector="ScrollBar:horizontal">
-        <Setter Property="Height" Value="{DynamicResource ScrollBarHeight}" />
+        <Setter Property="Height" Value="{DynamicResource ScrollBarThickness}" />
         <Setter Property="Template">
             <ControlTemplate>
                 <Border Background="{DynamicResource ThemeControlMidBrush}">
@@ -107,13 +107,13 @@
         </Setter>
     </Style>
     <Style Selector="ScrollBar:horizontal /template/ Thumb#thumb">
-        <Setter Property="MinWidth" Value="{DynamicResource ScrollBarWidth}" />
+        <Setter Property="MinWidth" Value="{DynamicResource ScrollBarThickness}" />
     </Style>
     <Style Selector="ScrollBar:vertical">
-        <Setter Property="Width" Value="{DynamicResource ScrollBarWidth}" />
+        <Setter Property="Width" Value="{DynamicResource ScrollBarThickness}" />
     </Style>
     <Style Selector="ScrollBar:vertical /template/ Thumb#thumb">
-        <Setter Property="MinHeight" Value="{DynamicResource ScrollBarHeight}" />
+        <Setter Property="MinHeight" Value="{DynamicResource ScrollBarThickness}" />
     </Style>
     <Style Selector="ScrollBar /template/ RepeatButton.repeat">
         <Setter Property="Padding" Value="2" />

+ 1 - 2
tests/Avalonia.Layout.UnitTests/FullLayoutTests.cs

@@ -99,8 +99,7 @@ namespace Avalonia.Layout.UnitTests
                     }
                 };
 
-                window.Resources["ScrollBarWidth"] = 10.0;
-                window.Resources["ScrollBarHeight"] = 10.0;
+                window.Resources["ScrollBarThickness"] = 10.0;
 
                 window.Show();
                 window.LayoutManager.ExecuteInitialLayoutPass(window);