1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-20 00:03:21 +08:00

Fix lots of small issues

This commit is contained in:
Dean Herbert 2017-06-05 16:43:23 +09:00
parent 0cb1df35e9
commit c3c56820fa

View File

@ -20,7 +20,7 @@ namespace osu.Game.Screens.Play.ReplaySettings
/// </summary> /// </summary>
protected abstract string Title { get; } protected abstract string Title { get; }
private const float transition_duration = 600; private const float transition_duration = 250;
private const int container_width = 270; private const int container_width = 270;
private const int border_thickness = 2; private const int border_thickness = 2;
private const int header_height = 30; private const int header_height = 30;
@ -28,7 +28,8 @@ namespace osu.Game.Screens.Play.ReplaySettings
private readonly FillFlowContainer content; private readonly FillFlowContainer content;
private readonly IconButton button; private readonly IconButton button;
private bool expanded;
private bool expanded = true;
private Color4 buttonActiveColour; private Color4 buttonActiveColour;
@ -81,7 +82,7 @@ namespace osu.Game.Screens.Play.ReplaySettings
Position = new Vector2(-15,0), Position = new Vector2(-15,0),
Icon = FontAwesome.fa_bars, Icon = FontAwesome.fa_bars,
Scale = new Vector2(0.75f), Scale = new Vector2(0.75f),
Action = triggerContentVisibility, Action = toggleContentVisibility,
}, },
} }
}, },
@ -111,17 +112,21 @@ namespace osu.Game.Screens.Play.ReplaySettings
protected override Container<Drawable> Content => content; protected override Container<Drawable> Content => content;
private void triggerContentVisibility() private void toggleContentVisibility()
{ {
content.ClearTransforms(); content.ClearTransforms();
content.AutoSizeAxes = expanded ? Axes.Y : Axes.None;
if (!expanded)
content.ResizeHeightTo(0, transition_duration, EasingTypes.OutQuint);
button.FadeColour(expanded ? buttonActiveColour : Color4.White, 200, EasingTypes.OutQuint);
expanded = !expanded; expanded = !expanded;
if (expanded)
content.AutoSizeAxes = Axes.Y;
else
{
content.AutoSizeAxes = Axes.None;
content.ResizeHeightTo(0, transition_duration, EasingTypes.OutQuint);
}
button.FadeColour(expanded ? buttonActiveColour : Color4.White, 200, EasingTypes.OutQuint);
} }
} }
} }