From 9a9ef657e26ea7f0bf382ce0041eebe575fb211d Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Thu, 3 Oct 2019 17:46:30 +0200 Subject: [PATCH] Ported Track layout code from WPF. To fix problem with scrollbar layout when the scrollbar range was large. NOTE: This commit adds `Track.IsDirectionReversed` and modifies the default direction of vertical tracks to be the reverse of before in order to match WPF. --- src/Avalonia.Controls/Primitives/Track.cs | 318 +++++++++++++++------ src/Avalonia.Themes.Default/ScrollBar.xaml | 3 +- src/Avalonia.Themes.Default/Slider.xaml | 2 +- 3 files changed, 236 insertions(+), 87 deletions(-) diff --git a/src/Avalonia.Controls/Primitives/Track.cs b/src/Avalonia.Controls/Primitives/Track.cs index 21a7dd68f8..0af8ac3415 100644 --- a/src/Avalonia.Controls/Primitives/Track.cs +++ b/src/Avalonia.Controls/Primitives/Track.cs @@ -1,10 +1,13 @@ -// Copyright (c) The Avalonia Project. All rights reserved. -// Licensed under the MIT license. See licence.md file in the project root for full license information. +// Portions of this source file are adapted from the Windows Presentation Foundation project. +// (https://github.com/dotnet/wpf/) +// +// Licensed to The Avalonia Project under MIT License, courtesy of The .NET Foundation. using System; using Avalonia.Input; using Avalonia.Layout; using Avalonia.Metadata; +using Avalonia.Utilities; namespace Avalonia.Controls.Primitives { @@ -34,6 +37,9 @@ namespace Avalonia.Controls.Primitives public static readonly StyledProperty