1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 22:47:24 +08:00

Adjust toolbar button sizing

This commit is contained in:
Dean Herbert 2020-09-03 16:29:15 +09:00
parent 98c5a04a09
commit 2fac0a180e
6 changed files with 10 additions and 17 deletions

View File

@ -698,9 +698,9 @@ namespace osu.Game
float offset = 0;
if (Settings.State.Value == Visibility.Visible)
offset += ToolbarButton.WIDTH / 2;
offset += Toolbar.HEIGHT / 2;
if (notifications.State.Value == Visibility.Visible)
offset -= ToolbarButton.WIDTH / 2;
offset -= Toolbar.HEIGHT / 2;
screenContainer.MoveToX(offset, SettingsPanel.TRANSITION_LENGTH, Easing.OutQuint);
}

View File

@ -4,22 +4,21 @@
using System;
using System.Linq;
using osu.Framework;
using osuTK;
using osuTK.Graphics;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Input.Events;
using osu.Framework.Threading;
using osu.Game.Graphics.Containers;
using osu.Game.Overlays.Toolbar;
using osuTK;
using osuTK.Graphics;
namespace osu.Game.Overlays.Settings
{
public class Sidebar : Container<SidebarButton>, IStateful<ExpandedState>
{
private readonly FillFlowContainer<SidebarButton> content;
public const float DEFAULT_WIDTH = ToolbarButton.WIDTH;
public const float DEFAULT_WIDTH = Toolbar.Toolbar.HEIGHT;
public const int EXPANDED_WIDTH = 200;
public event Action<ExpandedState> StateChanged;

View File

@ -9,6 +9,7 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Effects;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
using osu.Framework.Input.Bindings;
using osu.Framework.Input.Events;
using osu.Game.Graphics;
@ -25,8 +26,6 @@ namespace osu.Game.Overlays.Toolbar
{
public abstract class ToolbarButton : OsuClickableContainer, IKeyBindingHandler<GlobalAction>
{
public const float WIDTH = Toolbar.HEIGHT * 1.4f;
protected GlobalAction? Hotkey { get; set; }
public void SetIcon(Drawable icon)
@ -80,7 +79,7 @@ namespace osu.Game.Overlays.Toolbar
protected ToolbarButton()
: base(HoverSampleSet.Loud)
{
Width = WIDTH;
Width = Toolbar.HEIGHT;
RelativeSizeAxes = Axes.Y;
Children = new Drawable[]
@ -114,7 +113,7 @@ namespace osu.Game.Overlays.Toolbar
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
Size = new Vector2(20),
Size = new Vector2(26),
Alpha = 0,
},
DrawableText = new OsuSpriteText

View File

@ -37,7 +37,7 @@ namespace osu.Game.Overlays.Toolbar
},
ModeButtonLine = new Container
{
Size = new Vector2(ToolbarButton.WIDTH, 3),
Size = new Vector2(Toolbar.HEIGHT, 3),
Anchor = Anchor.BottomLeft,
Origin = Anchor.TopLeft,
Masking = true,

View File

@ -65,12 +65,6 @@ namespace osu.Game.Overlays.Toolbar
Parent.Click();
return base.OnClick(e);
}
protected override void LoadComplete()
{
base.LoadComplete();
IconContainer.Scale *= 1.4f;
}
}
}
}

View File

@ -10,6 +10,7 @@ namespace osu.Game.Overlays.Toolbar
{
public ToolbarSettingsButton()
{
Width *= 1.4f;
Hotkey = GlobalAction.ToggleSettings;
}