From 4f0aff3d9c2ad06df4c0197644f51cf6ec63df0c Mon Sep 17 00:00:00 2001 From: andy840119 Date: Fri, 14 Jun 2019 01:12:56 +0900 Subject: [PATCH] hide label when mod is empty --- osu.Game/Overlays/Mods/ModSection.cs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/osu.Game/Overlays/Mods/ModSection.cs b/osu.Game/Overlays/Mods/ModSection.cs index 50400e254f..9d9bb2ba6e 100644 --- a/osu.Game/Overlays/Mods/ModSection.cs +++ b/osu.Game/Overlays/Mods/ModSection.cs @@ -50,6 +50,34 @@ namespace osu.Game.Overlays.Mods ButtonsContainer.Children = modContainers; buttons = modContainers.OfType().ToArray(); + + Expanded = value.Any(); + } + } + + private bool expanded = true; + + public bool Expanded + { + set + { + if (expanded == value) return; + + expanded = value; + + this.ClearTransforms(); + + if (expanded) + { + this.AutoSizeAxes = Axes.Y; + this.headerLabel.FadeIn(200); + } + else + { + this.AutoSizeAxes = Axes.None; + this.headerLabel.FadeOut(200); + this.ResizeHeightTo(0, 200, Easing.OutQuint); + } } }