1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 13:27:23 +08:00

Highlight timeline drag area when hovered for better visibility

This commit is contained in:
Dean Herbert 2020-12-21 18:10:11 +09:00
parent d1be7c23d9
commit 423c6158e1

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)
{
@ -38,7 +44,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
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);