1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 18:32:56 +08:00

Adjust paddings and fills of toolbar buttons

This commit is contained in:
Dean Herbert 2023-12-28 03:43:38 +09:00
parent 70aa067eb1
commit 92c4c20a51
No known key found for this signature in database
5 changed files with 51 additions and 33 deletions

View File

@ -7,7 +7,6 @@ using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Extensions.EnumExtensions; using osu.Framework.Extensions.EnumExtensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Effects;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.Input; using osu.Framework.Input;
@ -74,6 +73,8 @@ namespace osu.Game.Overlays.Toolbar
private readonly SpriteText keyBindingTooltip; private readonly SpriteText keyBindingTooltip;
protected FillFlowContainer Flow; protected FillFlowContainer Flow;
protected readonly Container BackgroundContent;
[Resolved] [Resolved]
private RealmAccess realm { get; set; } = null!; private RealmAccess realm { get; set; } = null!;
@ -82,21 +83,33 @@ namespace osu.Game.Overlays.Toolbar
Width = Toolbar.HEIGHT; Width = Toolbar.HEIGHT;
RelativeSizeAxes = Axes.Y; RelativeSizeAxes = Axes.Y;
Padding = new MarginPadding(3);
Children = new Drawable[] Children = new Drawable[]
{ {
HoverBackground = new Box BackgroundContent = new Container
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Colour = OsuColour.Gray(80).Opacity(180), Masking = true,
Blending = BlendingParameters.Additive, CornerRadius = 6,
Alpha = 0, CornerExponent = 3f,
}, Children = new Drawable[]
flashBackground = new Box {
{ HoverBackground = new Box
RelativeSizeAxes = Axes.Both, {
Alpha = 0, RelativeSizeAxes = Axes.Both,
Colour = Color4.White.Opacity(100), Colour = OsuColour.Gray(80).Opacity(180),
Blending = BlendingParameters.Additive, Blending = BlendingParameters.Additive,
Alpha = 0,
},
flashBackground = new Box
{
RelativeSizeAxes = Axes.Both,
Alpha = 0,
Colour = Color4.White.Opacity(100),
Blending = BlendingParameters.Additive,
},
}
}, },
Flow = new FillFlowContainer Flow = new FillFlowContainer
{ {
@ -219,14 +232,6 @@ namespace osu.Game.Overlays.Toolbar
public OpaqueBackground() public OpaqueBackground()
{ {
RelativeSizeAxes = Axes.Both; RelativeSizeAxes = Axes.Both;
Masking = true;
MaskingSmoothness = 0;
EdgeEffect = new EdgeEffectParameters
{
Type = EdgeEffectType.Shadow,
Colour = Color4.Black.Opacity(40),
Radius = 5,
};
Children = new Drawable[] Children = new Drawable[]
{ {

View File

@ -42,21 +42,33 @@ namespace osu.Game.Overlays.Toolbar
clockDisplayMode = config.GetBindable<ToolbarClockDisplayMode>(OsuSetting.ToolbarClockDisplayMode); clockDisplayMode = config.GetBindable<ToolbarClockDisplayMode>(OsuSetting.ToolbarClockDisplayMode);
prefer24HourTime = config.GetBindable<bool>(OsuSetting.Prefer24HourTime); prefer24HourTime = config.GetBindable<bool>(OsuSetting.Prefer24HourTime);
Padding = new MarginPadding(3);
Children = new Drawable[] Children = new Drawable[]
{ {
hoverBackground = new Box new Container
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Colour = OsuColour.Gray(80).Opacity(180), Masking = true,
Blending = BlendingParameters.Additive, CornerRadius = 6,
Alpha = 0, CornerExponent = 3f,
}, Children = new Drawable[]
flashBackground = new Box {
{ hoverBackground = new Box
RelativeSizeAxes = Axes.Both, {
Alpha = 0, RelativeSizeAxes = Axes.Both,
Colour = Color4.White.Opacity(100), Colour = OsuColour.Gray(80).Opacity(180),
Blending = BlendingParameters.Additive, Blending = BlendingParameters.Additive,
Alpha = 0,
},
flashBackground = new Box
{
RelativeSizeAxes = Axes.Both,
Alpha = 0,
Colour = Color4.White.Opacity(100),
Blending = BlendingParameters.Additive,
},
}
}, },
new FillFlowContainer new FillFlowContainer
{ {

View File

@ -46,7 +46,7 @@ namespace osu.Game.Overlays.Toolbar
public ToolbarOverlayToggleButton() public ToolbarOverlayToggleButton()
{ {
Add(stateBackground = new Box BackgroundContent.Add(stateBackground = new Box
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Colour = OsuColour.Gray(150).Opacity(180), Colour = OsuColour.Gray(150).Opacity(180),

View File

@ -41,6 +41,7 @@ namespace osu.Game.Overlays.Toolbar
new OpaqueBackground new OpaqueBackground
{ {
Depth = 1, Depth = 1,
Masking = true,
}, },
ModeButtonLine = new Container ModeButtonLine = new Container
{ {

View File

@ -40,7 +40,7 @@ namespace osu.Game.Overlays.Toolbar
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours, IAPIProvider api, LoginOverlay? login) private void load(OsuColour colours, IAPIProvider api, LoginOverlay? login)
{ {
Add(new OpaqueBackground { Depth = 1 }); BackgroundContent.Add(new OpaqueBackground { Depth = 1 });
Flow.Add(new Container Flow.Add(new Container
{ {