diff --git a/osu.Game/Overlays/DragBar.cs b/osu.Game/Overlays/DragBar.cs index 9bc4d5834a..2ee986cd29 100644 --- a/osu.Game/Overlays/DragBar.cs +++ b/osu.Game/Overlays/DragBar.cs @@ -17,7 +17,8 @@ namespace osu.Game.Overlays protected readonly Box Fill; public Action SeekRequested; - private bool isDragging; + + public bool IsSeeking { get; private set; } private bool enabled = true; public bool IsEnabled @@ -56,7 +57,7 @@ namespace osu.Game.Overlays public void UpdatePosition(float position) { - if (isDragging || !IsEnabled) return; + if (IsSeeking || !IsEnabled) return; updatePosition(position); } @@ -72,7 +73,7 @@ namespace osu.Game.Overlays private void updatePosition(float position) { position = MathHelper.Clamp(position, 0, 1); - FillContainer.TransformTo(FillContainer.Width, position, 100, EasingTypes.OutQuint, new TransformWidth()); + fill.TransformTo(fill.Width, position, 200, EasingTypes.OutQuint, new TransformSeek()); } protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) @@ -87,15 +88,15 @@ namespace osu.Game.Overlays return true; } - protected override bool OnDragStart(InputState state) => isDragging = true; + protected override bool OnDragStart(InputState state) => IsSeeking = true; protected override bool OnDragEnd(InputState state) { - isDragging = false; + IsSeeking = false; return true; } - private class TransformWidth : TransformFloat + private class TransformSeek : TransformFloat { public override void Apply(Drawable d) { diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index c91618f959..73b7695dab 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -46,6 +46,8 @@ namespace osu.Game.Overlays private Container dragContainer; + private const float progress_height = 10; + private const float bottom_black_area_height = 50; public MusicController() @@ -117,53 +119,62 @@ namespace osu.Game.Overlays Text = @"Nothing to play", Font = @"Exo2.0-BoldItalic" }, - new FillFlowContainer