mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 05:32:54 +08:00
Merge pull request #14218 from peppy/nub-animation-speed
Adjust checkbox / sliderbar animation speeds to match sound effects better
This commit is contained in:
commit
c54a37a4ca
@ -21,6 +21,9 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
private const float border_width = 3;
|
private const float border_width = 3;
|
||||||
|
|
||||||
|
private const double animate_in_duration = 150;
|
||||||
|
private const double animate_out_duration = 500;
|
||||||
|
|
||||||
public Nub()
|
public Nub()
|
||||||
{
|
{
|
||||||
Box fill;
|
Box fill;
|
||||||
@ -77,20 +80,26 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
if (value)
|
if (value)
|
||||||
{
|
{
|
||||||
this.FadeColour(GlowingAccentColour, 500, Easing.OutQuint);
|
this.FadeColour(GlowingAccentColour, animate_in_duration, Easing.OutQuint);
|
||||||
FadeEdgeEffectTo(1, 500, Easing.OutQuint);
|
FadeEdgeEffectTo(1, animate_in_duration, Easing.OutQuint);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FadeEdgeEffectTo(0, 500);
|
FadeEdgeEffectTo(0, animate_out_duration);
|
||||||
this.FadeColour(AccentColour, 500);
|
this.FadeColour(AccentColour, animate_out_duration);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Expanded
|
public bool Expanded
|
||||||
{
|
{
|
||||||
set => this.ResizeTo(new Vector2(value ? EXPANDED_SIZE : COLLAPSED_SIZE, 12), 500, Easing.OutQuint);
|
set
|
||||||
|
{
|
||||||
|
if (value)
|
||||||
|
this.ResizeTo(new Vector2(EXPANDED_SIZE, 12), animate_in_duration, Easing.OutQuint);
|
||||||
|
else
|
||||||
|
this.ResizeTo(new Vector2(COLLAPSED_SIZE, 12), animate_out_duration, Easing.OutQuint);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly Bindable<bool> current = new Bindable<bool>();
|
private readonly Bindable<bool> current = new Bindable<bool>();
|
||||||
|
Loading…
Reference in New Issue
Block a user