1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 06:47:24 +08:00

hide label when mod is empty

This commit is contained in:
andy840119 2019-06-14 01:12:56 +09:00
parent 73a83e7f05
commit 4f0aff3d9c

View File

@ -50,6 +50,34 @@ namespace osu.Game.Overlays.Mods
ButtonsContainer.Children = modContainers;
buttons = modContainers.OfType<ModButton>().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);
}
}
}