2017-02-07 12:59:30 +08:00
|
|
|
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
2017-01-31 15:59:38 +08:00
|
|
|
|
|
2017-10-23 12:43:47 +08:00
|
|
|
|
using osu.Framework.Allocation;
|
2017-01-31 15:59:38 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
|
using osu.Framework.Graphics.Primitives;
|
|
|
|
|
using OpenTK;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Overlays.Toolbar
|
|
|
|
|
{
|
2017-03-07 09:59:19 +08:00
|
|
|
|
internal class ToolbarUserArea : Container
|
2017-01-31 15:59:38 +08:00
|
|
|
|
{
|
2017-02-08 18:53:50 +08:00
|
|
|
|
public LoginOverlay LoginOverlay;
|
2017-10-23 12:43:47 +08:00
|
|
|
|
private ToolbarUserButton button;
|
2017-01-31 15:59:38 +08:00
|
|
|
|
|
|
|
|
|
public override RectangleF BoundingBox => button.BoundingBox;
|
|
|
|
|
|
2017-10-23 12:43:47 +08:00
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load()
|
2017-01-31 15:59:38 +08:00
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Y;
|
2017-02-04 21:27:05 +08:00
|
|
|
|
AutoSizeAxes = Axes.X;
|
2017-01-31 15:59:38 +08:00
|
|
|
|
|
|
|
|
|
Children = new Drawable[] {
|
|
|
|
|
button = new ToolbarUserButton
|
|
|
|
|
{
|
2017-02-08 18:53:50 +08:00
|
|
|
|
Action = () => LoginOverlay.ToggleVisibility(),
|
2017-01-31 15:59:38 +08:00
|
|
|
|
},
|
2017-02-08 18:53:50 +08:00
|
|
|
|
LoginOverlay = new LoginOverlay
|
2017-01-31 15:59:38 +08:00
|
|
|
|
{
|
2017-02-05 22:17:54 +08:00
|
|
|
|
BypassAutoSizeAxes = Axes.Both,
|
2017-01-31 15:59:38 +08:00
|
|
|
|
Position = new Vector2(0, 1),
|
|
|
|
|
RelativePositionAxes = Axes.Y,
|
|
|
|
|
Anchor = Anchor.TopRight,
|
|
|
|
|
Origin = Anchor.TopRight,
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-10-23 12:43:47 +08:00
|
|
|
|
}
|