From 377ae3e685466fa1dd4c2519f102a29a8f7336fc Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Fri, 28 Feb 2020 12:48:06 +0300 Subject: [PATCH] Make a separate if section for all highlighted case --- .../Overlays/Changelog/UpdateStreamBadge.cs | 24 +++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/osu.Game/Overlays/Changelog/UpdateStreamBadge.cs b/osu.Game/Overlays/Changelog/UpdateStreamBadge.cs index dc9d3ccaed..5e10410f37 100644 --- a/osu.Game/Overlays/Changelog/UpdateStreamBadge.cs +++ b/osu.Game/Overlays/Changelog/UpdateStreamBadge.cs @@ -100,26 +100,20 @@ namespace osu.Game.Overlays.Changelog private void updateState() { - // Expand based on the local state - bool shouldExpand = Active.Value || IsHovered; - - bool allHighlighted = SelectedTab.Value == null && !externalDimRequested; - - // Expand based on whether no build is selected and the badge area is hovered - shouldExpand |= allHighlighted; - - if (shouldExpand) + if (SelectedTab.Value == null && !externalDimRequested) { expandingBar.Expand(); expandingBar.FadeTo(1, transition_duration, Easing.OutQuint); - } - else - { - expandingBar.Collapse(); - expandingBar.FadeTo(0.5f, transition_duration, Easing.OutQuint); + text.FadeTo(1, transition_duration, Easing.OutQuint); + return; } - text.FadeTo(IsHovered || (Active.Value && !externalDimRequested) || allHighlighted ? 1 : 0.5f, transition_duration, Easing.OutQuint); + var shouldExpand = Active.Value || IsHovered; + + expandingBar.IsCollapsed = !shouldExpand; + expandingBar.FadeTo(shouldExpand ? 1 : 0.5f, transition_duration, Easing.OutQuint); + + text.FadeTo(IsHovered || (Active.Value && !externalDimRequested) ? 1 : 0.5f, transition_duration, Easing.OutQuint); } private bool externalDimRequested;