mirror of
https://github.com/ppy/osu
synced 2025-01-10 08:09:40 +00:00
Merge pull request #14360 from peppy/improve-timeline-tick-visibility
Improve visibility of repeat ticks / drag areas on timeline
This commit is contained in:
commit
d8e9845d00
@ -166,14 +166,9 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (IsSelected)
|
if (IsSelected)
|
||||||
{
|
|
||||||
border.Show();
|
border.Show();
|
||||||
colour = colour.Lighten(0.3f);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
border.Hide();
|
border.Hide();
|
||||||
}
|
|
||||||
|
|
||||||
if (Item is IHasDuration duration && duration.Duration > 0)
|
if (Item is IHasDuration duration && duration.Duration > 0)
|
||||||
circle.Colour = ColourInfo.GradientHorizontal(colour, colour.Lighten(0.4f));
|
circle.Colour = ColourInfo.GradientHorizontal(colour, colour.Lighten(0.4f));
|
||||||
@ -212,14 +207,9 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
|
|
||||||
for (int i = 0; i < repeats.RepeatCount; i++)
|
for (int i = 0; i < repeats.RepeatCount; i++)
|
||||||
{
|
{
|
||||||
repeatsContainer.Add(new Circle
|
repeatsContainer.Add(new Tick
|
||||||
{
|
{
|
||||||
Size = new Vector2(circle_size / 3),
|
X = (float)(i + 1) / (repeats.RepeatCount + 1)
|
||||||
Alpha = 0.2f,
|
|
||||||
Anchor = Anchor.CentreLeft,
|
|
||||||
Origin = Anchor.Centre,
|
|
||||||
RelativePositionAxes = Axes.X,
|
|
||||||
X = (float)(i + 1) / (repeats.RepeatCount + 1),
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -233,6 +223,17 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
|
|
||||||
public override Vector2 ScreenSpaceSelectionPoint => ScreenSpaceDrawQuad.TopLeft;
|
public override Vector2 ScreenSpaceSelectionPoint => ScreenSpaceDrawQuad.TopLeft;
|
||||||
|
|
||||||
|
private class Tick : Circle
|
||||||
|
{
|
||||||
|
public Tick()
|
||||||
|
{
|
||||||
|
Size = new Vector2(circle_size / 4);
|
||||||
|
Anchor = Anchor.CentreLeft;
|
||||||
|
Origin = Anchor.Centre;
|
||||||
|
RelativePositionAxes = Axes.X;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public class DragArea : Circle
|
public class DragArea : Circle
|
||||||
{
|
{
|
||||||
private readonly HitObject hitObject;
|
private readonly HitObject hitObject;
|
||||||
@ -304,20 +305,15 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
|
|
||||||
private void updateState()
|
private void updateState()
|
||||||
{
|
{
|
||||||
if (hasMouseDown)
|
float scale = 0.5f;
|
||||||
{
|
|
||||||
this.ScaleTo(0.7f, 200, Easing.OutQuint);
|
|
||||||
}
|
|
||||||
else if (IsHovered)
|
|
||||||
{
|
|
||||||
this.ScaleTo(0.8f, 200, Easing.OutQuint);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.ScaleTo(0.6f, 200, Easing.OutQuint);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.FadeTo(IsHovered || hasMouseDown ? 0.8f : 0.2f, 200, Easing.OutQuint);
|
if (hasMouseDown)
|
||||||
|
scale = 0.6f;
|
||||||
|
else if (IsHovered)
|
||||||
|
scale = 0.7f;
|
||||||
|
|
||||||
|
this.ScaleTo(scale, 200, Easing.OutQuint);
|
||||||
|
this.FadeTo(IsHovered || hasMouseDown ? 1f : 0.9f, 200, Easing.OutQuint);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
|
Loading…
Reference in New Issue
Block a user