From 29305ca0eb2737395178d588873157f0c69b4e34 Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Fri, 21 Jun 2019 13:24:12 +0300 Subject: [PATCH] fix broken layout --- osu.Game/Overlays/OverlayTabControl.cs | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/osu.Game/Overlays/OverlayTabControl.cs b/osu.Game/Overlays/OverlayTabControl.cs index 8fd53e0f36..20649c8a74 100644 --- a/osu.Game/Overlays/OverlayTabControl.cs +++ b/osu.Game/Overlays/OverlayTabControl.cs @@ -114,7 +114,7 @@ namespace osu.Game.Overlays base.OnHover(e); if (!Active.Value) - OnActivated(); + HoverAction(); return true; } @@ -124,20 +124,18 @@ namespace osu.Game.Overlays base.OnHoverLost(e); if (!Active.Value) - OnDeactivated(); + UnhoverAction(); } protected override void OnActivated() { - bar.Expand(); - Text.FadeColour(Color4.White, 120, Easing.InQuad); + HoverAction(); Text.Font = Text.Font.With(weight: FontWeight.Bold); } protected override void OnDeactivated() { - bar.Collapse(); - Text.FadeColour(AccentColour, 120, Easing.InQuad); + UnhoverAction(); Text.Font = Text.Font.With(weight: FontWeight.Medium); } @@ -148,6 +146,18 @@ namespace osu.Game.Overlays else OnDeactivated(); } + + protected virtual void HoverAction() + { + bar.Expand(); + Text.FadeColour(Color4.White, 120, Easing.InQuad); + } + + protected virtual void UnhoverAction() + { + bar.Collapse(); + Text.FadeColour(AccentColour, 120, Easing.InQuad); + } } } }