1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-23 05:27:26 +08:00
osu-lazer/osu.Game/Overlays/Toolbar/ToolbarUserArea.cs
2017-02-07 14:27:41 +09:00

46 lines
1.3 KiB
C#

// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives;
using OpenTK;
namespace osu.Game.Overlays.Toolbar
{
class ToolbarUserArea : Container
{
private LoginOverlay loginOverlay;
private ToolbarUserButton button;
public override RectangleF BoundingBox => button.BoundingBox;
public override bool Contains(Vector2 screenSpacePos) => true;
public ToolbarUserArea()
{
RelativeSizeAxes = Axes.Y;
AutoSizeAxes = Axes.X;
Children = new Drawable[] {
button = new ToolbarUserButton
{
Action = toggle,
},
loginOverlay = new LoginOverlay
{
BypassAutoSizeAxes = Axes.Both,
Position = new Vector2(0, 1),
RelativePositionAxes = Axes.Y,
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
}
};
}
private void toggle()
{
loginOverlay.ToggleVisibility();
}
}
}