From c3c56820fa9a1e89737b53936d3ff7c17990da12 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 5 Jun 2017 16:43:23 +0900 Subject: [PATCH] Fix lots of small issues --- .../ReplaySettings/ReplaySettingsGroup.cs | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/osu.Game/Screens/Play/ReplaySettings/ReplaySettingsGroup.cs b/osu.Game/Screens/Play/ReplaySettings/ReplaySettingsGroup.cs index 57111baa1c..47820ff462 100644 --- a/osu.Game/Screens/Play/ReplaySettings/ReplaySettingsGroup.cs +++ b/osu.Game/Screens/Play/ReplaySettings/ReplaySettingsGroup.cs @@ -20,7 +20,7 @@ namespace osu.Game.Screens.Play.ReplaySettings /// 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 border_thickness = 2; private const int header_height = 30; @@ -28,7 +28,8 @@ namespace osu.Game.Screens.Play.ReplaySettings private readonly FillFlowContainer content; private readonly IconButton button; - private bool expanded; + + private bool expanded = true; private Color4 buttonActiveColour; @@ -81,7 +82,7 @@ namespace osu.Game.Screens.Play.ReplaySettings Position = new Vector2(-15,0), Icon = FontAwesome.fa_bars, Scale = new Vector2(0.75f), - Action = triggerContentVisibility, + Action = toggleContentVisibility, }, } }, @@ -111,17 +112,21 @@ namespace osu.Game.Screens.Play.ReplaySettings protected override Container Content => content; - private void triggerContentVisibility() + private void toggleContentVisibility() { 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; + + 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); } } }