1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 20:07:25 +08:00

Adjust appearance of keybinding subpanel

This commit is contained in:
Bartłomiej Dach 2021-10-09 20:29:44 +02:00
parent 855a74b8a0
commit b8616bf910
No known key found for this signature in database
GPG Key ID: BCECCD4FA41F6497
3 changed files with 16 additions and 15 deletions

View File

@ -78,7 +78,7 @@ namespace osu.Game.Overlays.Settings.Sections.Input
private RealmContextFactory realmFactory { get; set; }
[BackgroundDependencyLoader]
private void load(OsuColour colours)
private void load(OverlayColourProvider colourProvider)
{
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
@ -101,7 +101,7 @@ namespace osu.Game.Overlays.Settings.Sections.Input
EdgeEffect = new EdgeEffectParameters
{
Radius = 2,
Colour = colours.YellowDark.Opacity(0),
Colour = colourProvider.Highlight1.Opacity(0),
Type = EdgeEffectType.Shadow,
Hollow = true,
},
@ -110,13 +110,12 @@ namespace osu.Game.Overlays.Settings.Sections.Input
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.Black,
Alpha = 0.6f,
Colour = colourProvider.Background5,
},
text = new OsuSpriteText
{
Text = action.GetLocalisableDescription(),
Margin = new MarginPadding(padding),
Margin = new MarginPadding(1.5f * padding),
},
buttons = new FillFlowContainer<KeyButton>
{
@ -405,7 +404,8 @@ namespace osu.Game.Overlays.Settings.Sections.Input
private readonly Box box;
public readonly OsuSpriteText Text;
private Color4 hoverColour;
[Resolved]
private OverlayColourProvider colourProvider { get; set; }
private bool isBinding;
@ -448,7 +448,6 @@ namespace osu.Game.Overlays.Settings.Sections.Input
box = new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.Black
},
Text = new OsuSpriteText
{
@ -463,9 +462,9 @@ namespace osu.Game.Overlays.Settings.Sections.Input
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
private void load()
{
hoverColour = colours.YellowDark;
updateHoverState();
}
protected override bool OnHover(HoverEvent e)
@ -484,12 +483,12 @@ namespace osu.Game.Overlays.Settings.Sections.Input
{
if (isBinding)
{
box.FadeColour(Color4.White, transition_time, Easing.OutQuint);
box.FadeColour(colourProvider.Light2, transition_time, Easing.OutQuint);
Text.FadeColour(Color4.Black, transition_time, Easing.OutQuint);
}
else
{
box.FadeColour(IsHovered ? hoverColour : Color4.Black, transition_time, Easing.OutQuint);
box.FadeColour(IsHovered ? colourProvider.Light4 : colourProvider.Background6, transition_time, Easing.OutQuint);
Text.FadeColour(IsHovered ? Color4.Black : Color4.White, transition_time, Easing.OutQuint);
}
}

View File

@ -27,8 +27,7 @@ namespace osu.Game.Overlays.Settings.Sections.Input
{
this.variant = variant;
FlowContent.Spacing = new Vector2(0, 1);
FlowContent.Padding = new MarginPadding { Left = SettingsPanel.CONTENT_MARGINS, Right = SettingsPanel.CONTENT_MARGINS };
FlowContent.Spacing = new Vector2(0, 3);
}
[BackgroundDependencyLoader]

View File

@ -10,7 +10,6 @@ using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using osu.Game.Overlays.Settings;
using osuTK;
using osuTK.Graphics;
namespace osu.Game.Overlays
{
@ -36,12 +35,16 @@ namespace osu.Game.Overlays
private class BackButton : OsuButton
{
[Resolved]
private OverlayColourProvider colourProvider { get; set; }
[BackgroundDependencyLoader]
private void load()
{
Size = new Vector2(Sidebar.DEFAULT_WIDTH);
BackgroundColour = Color4.Black;
BackgroundColour = colourProvider.Background5;
Hover.Colour = Colour4.Transparent;
AddRange(new Drawable[]
{