From 06ba894e39a48b902bdeddcfd3ebf14a2bd475d3 Mon Sep 17 00:00:00 2001 From: Chandler Cox Date: Sat, 8 Apr 2023 23:00:43 -0500 Subject: [PATCH] Various changes to scroll bar to make it feel better --- Source/Engine/UI/GUI/Panels/ScrollBar.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/Engine/UI/GUI/Panels/ScrollBar.cs b/Source/Engine/UI/GUI/Panels/ScrollBar.cs index d91a88adf..a51a1df40 100644 --- a/Source/Engine/UI/GUI/Panels/ScrollBar.cs +++ b/Source/Engine/UI/GUI/Panels/ScrollBar.cs @@ -19,11 +19,11 @@ namespace FlaxEngine.GUI /// /// The default minimum opacity. /// - public const float DefaultMinimumOpacity = 0.7f; + public const float DefaultMinimumOpacity = 0.75f; // Scrolling - private float _clickChange = 20, _scrollChange = 75; + private float _clickChange = 20, _scrollChange = 100; private float _minimum, _maximum = 100; private float _value, _targetValue; private readonly Orientation _orientation; @@ -51,17 +51,17 @@ namespace FlaxEngine.GUI /// /// Gets or sets the thumb box thickness. /// - public float ThumbThickness { get; set; } = 6; + public float ThumbThickness { get; set; } = 8; /// /// Gets or sets the track line thickness. /// - public float TrackThickness { get; set; } = 1; + public float TrackThickness { get; set; } = 2.0f; /// /// Gets or sets the value smoothing scale (0 to not use it). /// - public float SmoothingScale { get; set; } = 1; + public float SmoothingScale { get; set; } = 0.6f; /// /// Gets a value indicating whether use scroll value smoothing. @@ -246,7 +246,7 @@ namespace FlaxEngine.GUI var height = Height; float trackSize = TrackSize; float range = _maximum - _minimum; - _thumbSize = Mathf.Min(trackSize, Mathf.Max(trackSize / range * 10.0f, 30.0f)); + _thumbSize = Mathf.Min(trackSize - 10, Mathf.Max(trackSize / range * 100.0f, 50.0f)); float pixelRange = trackSize - _thumbSize; float percentage = (_value - _minimum) / range; float thumbPosition = (int)(percentage * pixelRange);