mirror of https://github.com/ppy/osu
now button can hide content
This commit is contained in:
parent
a21343da23
commit
a9f37d3e78
|
@ -20,6 +20,7 @@ public abstract class OptionContainer : Container
|
||||||
public abstract string Title { get; }
|
public abstract string Title { get; }
|
||||||
|
|
||||||
private readonly FillFlowContainer content;
|
private readonly FillFlowContainer content;
|
||||||
|
private bool contentIsVisible;
|
||||||
|
|
||||||
protected OptionContainer()
|
protected OptionContainer()
|
||||||
{
|
{
|
||||||
|
@ -71,6 +72,7 @@ protected OptionContainer()
|
||||||
Position = new Vector2(-15,0),
|
Position = new Vector2(-15,0),
|
||||||
Icon = FontAwesome.fa_bars,
|
Icon = FontAwesome.fa_bars,
|
||||||
Scale = new Vector2(0.7f),
|
Scale = new Vector2(0.7f),
|
||||||
|
Action = () => triggerContentVisibility(),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -93,5 +95,15 @@ protected OptionContainer()
|
||||||
{
|
{
|
||||||
content.Add(drawable);
|
content.Add(drawable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void triggerContentVisibility()
|
||||||
|
{
|
||||||
|
if (contentIsVisible)
|
||||||
|
content.Show();
|
||||||
|
else
|
||||||
|
content.Hide();
|
||||||
|
|
||||||
|
contentIsVisible = !contentIsVisible;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue