From 6327b0c72a74d5861f281a3234c65e205397de9c Mon Sep 17 00:00:00 2001 From: Max Katz Date: Mon, 19 Apr 2021 12:01:19 -0400 Subject: [PATCH 1/2] Change HorizontalScrollBarVisibility default --- src/Avalonia.Controls/ScrollViewer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Avalonia.Controls/ScrollViewer.cs b/src/Avalonia.Controls/ScrollViewer.cs index 6b75149d62..90c4e05943 100644 --- a/src/Avalonia.Controls/ScrollViewer.cs +++ b/src/Avalonia.Controls/ScrollViewer.cs @@ -120,7 +120,7 @@ namespace Avalonia.Controls public static readonly AttachedProperty HorizontalScrollBarVisibilityProperty = AvaloniaProperty.RegisterAttached( nameof(HorizontalScrollBarVisibility), - ScrollBarVisibility.Hidden); + ScrollBarVisibility.Disabled); /// /// Defines the VerticalScrollBarMaximum property. From 57b7a3a8b282929f384f09605b82e0efe6f6a593 Mon Sep 17 00:00:00 2001 From: Max Katz Date: Mon, 19 Apr 2021 12:35:47 -0400 Subject: [PATCH 2/2] Update tests per new default --- tests/Avalonia.Controls.UnitTests/ScrollViewerTests.cs | 2 +- .../LayoutableTests_EffectiveViewportChanged.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/Avalonia.Controls.UnitTests/ScrollViewerTests.cs b/tests/Avalonia.Controls.UnitTests/ScrollViewerTests.cs index ab21c5d330..c3d35653cc 100644 --- a/tests/Avalonia.Controls.UnitTests/ScrollViewerTests.cs +++ b/tests/Avalonia.Controls.UnitTests/ScrollViewerTests.cs @@ -37,7 +37,7 @@ namespace Avalonia.Controls.UnitTests target.HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled; target.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto; - Assert.Equal(new[] { true, false, true }, values); + Assert.Equal(new[] { false, true }, values); } [Fact] diff --git a/tests/Avalonia.Layout.UnitTests/LayoutableTests_EffectiveViewportChanged.cs b/tests/Avalonia.Layout.UnitTests/LayoutableTests_EffectiveViewportChanged.cs index f1cec24516..178855d71c 100644 --- a/tests/Avalonia.Layout.UnitTests/LayoutableTests_EffectiveViewportChanged.cs +++ b/tests/Avalonia.Layout.UnitTests/LayoutableTests_EffectiveViewportChanged.cs @@ -162,7 +162,7 @@ namespace Avalonia.Layout.UnitTests { var root = CreateRoot(); var target = new Canvas { Width = 200, Height = 200 }; - var scroller = new ScrollViewer { Width = 100, Height = 100, Content = target, Template = ScrollViewerTemplate() }; + var scroller = new ScrollViewer { Width = 100, Height = 100, Content = target, Template = ScrollViewerTemplate(), HorizontalScrollBarVisibility = ScrollBarVisibility.Hidden }; var raised = 0; target.EffectiveViewportChanged += (s, e) => @@ -185,7 +185,7 @@ namespace Avalonia.Layout.UnitTests { var root = CreateRoot(); var target = new Canvas { Width = 200, Height = 200 }; - var scroller = new ScrollViewer { Width = 100, Height = 100, Content = target, Template = ScrollViewerTemplate() }; + var scroller = new ScrollViewer { Width = 100, Height = 100, Content = target, Template = ScrollViewerTemplate(), HorizontalScrollBarVisibility = ScrollBarVisibility.Hidden }; var raised = 0; root.Child = scroller;