1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-18 06:27:18 +08:00

Merge pull request #11238 from peppy/editor-timeline-selection-ux

Improve drag and selection UX on editor timeline
This commit is contained in:
Dean Herbert 2020-12-22 12:58:24 +09:00 committed by GitHub
commit 9de42f8646
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 3 deletions

View File

@ -10,6 +10,7 @@ using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Input.Events;
using osu.Framework.Utils;
using osu.Game.Graphics;
using osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.Objects;
using osu.Game.Screens.Edit.Components.Timelines.Summary.Parts;
@ -25,10 +26,15 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
[Resolved]
private EditorBeatmap beatmap { get; set; }
[Resolved]
private OsuColour colours { get; set; }
private DragEvent lastDragEvent;
private Bindable<HitObject> placement;
private SelectionBlueprint placementBlueprint;
private readonly Box backgroundBox;
public TimelineBlueprintContainer(HitObjectComposer composer)
: base(composer)
{
@ -36,9 +42,9 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
Anchor = Anchor.Centre;
Origin = Anchor.Centre;
Height = 0.4f;
Height = 0.6f;
AddInternal(new Box
AddInternal(backgroundBox = new Box
{
Colour = Color4.Black,
RelativeSizeAxes = Axes.Both,
@ -77,6 +83,18 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
protected override Container<SelectionBlueprint> CreateSelectionBlueprintContainer() => new TimelineSelectionBlueprintContainer { RelativeSizeAxes = Axes.Both };
protected override bool OnHover(HoverEvent e)
{
backgroundBox.FadeColour(colours.BlueLighter, 120, Easing.OutQuint);
return base.OnHover(e);
}
protected override void OnHoverLost(HoverLostEvent e)
{
backgroundBox.FadeColour(Color4.Black, 600, Easing.OutQuint);
base.OnHoverLost(e);
}
protected override void OnDrag(DragEvent e)
{
handleScrollViaDrag(e);

View File

@ -29,7 +29,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
{
private const float thickness = 5;
private const float shadow_radius = 5;
private const float circle_size = 24;
private const float circle_size = 34;
public Action<DragEvent> OnDragHandled;