1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 18:42:56 +08:00

Centralise toolbar size variables and adjust to design.

This commit is contained in:
Dean Herbert 2017-02-08 20:14:17 +09:00
parent 143cfae93a
commit b6398a1c77
No known key found for this signature in database
GPG Key ID: 46D71BF4958ABB49
4 changed files with 11 additions and 6 deletions

View File

@ -11,13 +11,14 @@ using osu.Framework.Graphics.Transformations;
using osu.Framework.Input;
using osu.Framework.Threading;
using osu.Game.Graphics;
using osu.Game.Overlays.Toolbar;
namespace osu.Game.Overlays.Options
{
public class Sidebar : Container
{
private FlowContainer content;
internal const int DEFAULT_WIDTH = 60;
internal const float DEFAULT_WIDTH = ToolbarButton.WIDTH;
internal const int EXPANDED_WIDTH = 200;
protected override Container<Drawable> Content => content;

View File

@ -16,7 +16,7 @@ namespace osu.Game.Overlays.Toolbar
{
public class Toolbar : OverlayContainer
{
public const float HEIGHT = 50;
public const float HEIGHT = 40;
public Action OnHome;
public Action<PlayMode> OnPlayModeChange;

View File

@ -21,6 +21,8 @@ namespace osu.Game.Overlays.Toolbar
{
public class ToolbarButton : Container
{
public const float WIDTH = Toolbar.HEIGHT * 1.4f;
public FontAwesome Icon
{
get { return DrawableIcon.Icon; }
@ -66,6 +68,9 @@ namespace osu.Game.Overlays.Toolbar
public ToolbarButton()
{
Width = WIDTH;
RelativeSizeAxes = Axes.Y;
Children = new Drawable[]
{
HoverBackground = new Box
@ -80,7 +85,7 @@ namespace osu.Game.Overlays.Toolbar
Direction = FlowDirection.HorizontalOnly,
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Padding = new MarginPadding { Left = 20, Right = 20 },
Padding = new MarginPadding { Left = Toolbar.HEIGHT / 2, Right = Toolbar.HEIGHT / 2 },
Spacing = new Vector2(5),
RelativeSizeAxes = Axes.Y,
AutoSizeAxes = Axes.X,
@ -121,9 +126,6 @@ namespace osu.Game.Overlays.Toolbar
}
}
};
RelativeSizeAxes = Axes.Y;
AutoSizeAxes = Axes.X;
}
[BackgroundDependencyLoader]

View File

@ -20,6 +20,8 @@ namespace osu.Game.Overlays.Toolbar
public ToolbarUserButton()
{
AutoSizeAxes = Axes.X;
DrawableText.Font = @"Exo2.0-MediumItalic";
Add(new OpaqueBackground { Depth = 1 });