now button can hide content

This commit is contained in:
EVAST9919 2017-05-17 17:24:52 +03:00
parent a21343da23
commit a9f37d3e78
1 changed files with 12 additions and 0 deletions

View File

@ -20,6 +20,7 @@ public abstract class OptionContainer : Container
public abstract string Title { get; }
private readonly FillFlowContainer content;
private bool contentIsVisible;
protected OptionContainer()
{
@ -71,6 +72,7 @@ protected OptionContainer()
Position = new Vector2(-15,0),
Icon = FontAwesome.fa_bars,
Scale = new Vector2(0.7f),
Action = () => triggerContentVisibility(),
},
}
},
@ -93,5 +95,15 @@ protected OptionContainer()
{
content.Add(drawable);
}
private void triggerContentVisibility()
{
if (contentIsVisible)
content.Show();
else
content.Hide();
contentIsVisible = !contentIsVisible;
}
}
}