From aa75a2aeb04fcc701da394734a09a62948fa6719 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Tue, 24 Aug 2021 17:15:43 +0200 Subject: [PATCH] Adjust curve and keyframes UI to be easier to use with a mouse #519 --- Source/Editor/GUI/CurveEditor.cs | 4 ++-- Source/Editor/GUI/Timeline/GUI/Background.cs | 2 +- Source/Editor/GUI/Timeline/GUI/KeyframesEditor.cs | 2 +- Source/Editor/GUI/Timeline/Track.cs | 2 +- Source/Editor/GUI/Timeline/Tracks/CurvePropertyTrack.cs | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/Editor/GUI/CurveEditor.cs b/Source/Editor/GUI/CurveEditor.cs index edbff94b5a..58f830f29b 100644 --- a/Source/Editor/GUI/CurveEditor.cs +++ b/Source/Editor/GUI/CurveEditor.cs @@ -273,7 +273,7 @@ public void UpdateTooltip() /// /// The keyframes size. /// - protected static readonly Vector2 KeyframesSize = new Vector2(5.0f); + protected static readonly Vector2 KeyframesSize = new Vector2(7.0f); /// /// The colors for the keyframe points. @@ -1296,7 +1296,7 @@ public override void UpdateKeyframes() if (_showCollapsed) { point.Y = 1.0f; - p.Size = new Vector2(4.0f / viewScale.X, Height - 2.0f); + p.Size = new Vector2(KeyframesSize.X / viewScale.X, Height - 2.0f); p.Visible = p.Component == 0; } else diff --git a/Source/Editor/GUI/Timeline/GUI/Background.cs b/Source/Editor/GUI/Timeline/GUI/Background.cs index 40537e3772..fb69db363d 100644 --- a/Source/Editor/GUI/Timeline/GUI/Background.cs +++ b/Source/Editor/GUI/Timeline/GUI/Background.cs @@ -75,7 +75,7 @@ public override void Draw() var track = tracks[i]; if (track.Visible && _timeline.SelectedTracks.Contains(track) && _timeline.ContainsFocus) { - Render2D.FillRectangle(new Rectangle(areaLeft, track.Top, areaRight, track.Height), style.BackgroundSelected); + Render2D.FillRectangle(new Rectangle(areaLeft, track.Top, areaRight, track.Height), style.BackgroundSelected.RGBMultiplied(0.4f)); } } diff --git a/Source/Editor/GUI/Timeline/GUI/KeyframesEditor.cs b/Source/Editor/GUI/Timeline/GUI/KeyframesEditor.cs index ecec528adb..df03586457 100644 --- a/Source/Editor/GUI/Timeline/GUI/KeyframesEditor.cs +++ b/Source/Editor/GUI/Timeline/GUI/KeyframesEditor.cs @@ -509,7 +509,7 @@ public void UpdateTooltip() /// /// The keyframes size. /// - private static readonly Vector2 KeyframesSize = new Vector2(5.0f); + private static readonly Vector2 KeyframesSize = new Vector2(7.0f); private Contents _contents; private Panel _mainPanel; diff --git a/Source/Editor/GUI/Timeline/Track.cs b/Source/Editor/GUI/Timeline/Track.cs index 66528efabf..561b5fe3f8 100644 --- a/Source/Editor/GUI/Timeline/Track.cs +++ b/Source/Editor/GUI/Timeline/Track.cs @@ -32,7 +32,7 @@ public class Track : ContainerControl /// /// The default drag insert position margin. /// - public const float DefaultDragInsertPositionMargin = 2.0f; + public const float DefaultDragInsertPositionMargin = 4.0f; /// /// The header height. diff --git a/Source/Editor/GUI/Timeline/Tracks/CurvePropertyTrack.cs b/Source/Editor/GUI/Timeline/Tracks/CurvePropertyTrack.cs index 47d077ece4..f1454e1b88 100644 --- a/Source/Editor/GUI/Timeline/Tracks/CurvePropertyTrack.cs +++ b/Source/Editor/GUI/Timeline/Tracks/CurvePropertyTrack.cs @@ -251,7 +251,7 @@ private void UpdateCurve() Parent = Curve, }; } - var splitterHeight = 4.0f; + var splitterHeight = 5.0f; _splitter.Bounds = new Rectangle(0, Curve.Height - splitterHeight, Curve.Width, splitterHeight); } }