1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 21:43:04 +08:00

Login overlay should disappear when toolbar is hidden.

This commit is contained in:
Dean Herbert 2017-02-08 19:53:50 +09:00
parent a7dac15d05
commit 143cfae93a
No known key found for this signature in database
GPG Key ID: 46D71BF4958ABB49
2 changed files with 8 additions and 10 deletions

View File

@ -22,8 +22,9 @@ namespace osu.Game.Overlays.Toolbar
public Action<PlayMode> OnPlayModeChange;
private ToolbarModeSelector modeSelector;
private ToolbarUserArea userArea;
private const int transition_time = 300;
private const int transition_time = 500;
private const float alpha_hovering = 0.8f;
private const float alpha_normal = 0.6f;
@ -67,7 +68,7 @@ namespace osu.Game.Overlays.Toolbar
{
Icon = FontAwesome.fa_search
},
new ToolbarUserArea(),
userArea = new ToolbarUserArea(),
new ToolbarButton
{
Icon = FontAwesome.fa_bars
@ -132,6 +133,8 @@ namespace osu.Game.Overlays.Toolbar
protected override void PopOut()
{
userArea?.LoginOverlay.Hide();
MoveToY(-DrawSize.Y, transition_time, EasingTypes.OutQuint);
FadeOut(transition_time);
}

View File

@ -10,7 +10,7 @@ namespace osu.Game.Overlays.Toolbar
{
class ToolbarUserArea : Container
{
private LoginOverlay loginOverlay;
public LoginOverlay LoginOverlay;
private ToolbarUserButton button;
public override RectangleF BoundingBox => button.BoundingBox;
@ -25,9 +25,9 @@ namespace osu.Game.Overlays.Toolbar
Children = new Drawable[] {
button = new ToolbarUserButton
{
Action = toggle,
Action = () => LoginOverlay.ToggleVisibility(),
},
loginOverlay = new LoginOverlay
LoginOverlay = new LoginOverlay
{
BypassAutoSizeAxes = Axes.Both,
Position = new Vector2(0, 1),
@ -37,10 +37,5 @@ namespace osu.Game.Overlays.Toolbar
}
};
}
private void toggle()
{
loginOverlay.ToggleVisibility();
}
}
}