mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 12:43:16 +08:00
Adjust appearance of keybinding subpanel
This commit is contained in:
parent
855a74b8a0
commit
b8616bf910
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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]
|
||||
|
@ -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[]
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user