mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 10:52:53 +08:00
Adjust back button to match style better
This commit is contained in:
parent
8e13f65c5d
commit
5d0b524794
@ -2,6 +2,7 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
|
||||
@ -23,6 +24,7 @@ namespace osu.Game.Overlays.Settings
|
||||
private void load()
|
||||
{
|
||||
BackgroundColour = ColourProvider.Background5;
|
||||
Hover.Colour = ColourProvider.Light4;
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
@ -40,6 +42,9 @@ namespace osu.Game.Overlays.Settings
|
||||
|
||||
protected override void OnHoverLost(HoverLostEvent e) => UpdateState();
|
||||
|
||||
protected abstract void UpdateState();
|
||||
protected virtual void UpdateState()
|
||||
{
|
||||
Hover.FadeTo(IsHovered ? 0.1f : 0, FADE_DURATION, Easing.OutQuint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -111,12 +111,11 @@ namespace osu.Game.Overlays.Settings
|
||||
private void load()
|
||||
{
|
||||
selectionIndicator.Colour = ColourProvider.Highlight1;
|
||||
Hover.Colour = ColourProvider.Light4;
|
||||
}
|
||||
|
||||
protected override void UpdateState()
|
||||
{
|
||||
Hover.FadeTo(IsHovered ? 0.1f : 0, FADE_DURATION, Easing.OutQuint);
|
||||
base.UpdateState();
|
||||
|
||||
if (Selected)
|
||||
{
|
||||
|
@ -47,7 +47,9 @@ namespace osu.Game.Overlays
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
Size = new Vector2(SettingsSidebar.DEFAULT_WIDTH);
|
||||
Size = new Vector2(SettingsSidebar.EXPANDED_WIDTH);
|
||||
|
||||
Padding = new MarginPadding(5);
|
||||
|
||||
AddRange(new Drawable[]
|
||||
{
|
||||
@ -61,7 +63,8 @@ namespace osu.Game.Overlays
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Size = new Vector2(15),
|
||||
Y = -5,
|
||||
Size = new Vector2(30),
|
||||
Shadow = true,
|
||||
Icon = FontAwesome.Solid.ChevronLeft
|
||||
},
|
||||
@ -69,8 +72,8 @@ namespace osu.Game.Overlays
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Y = 15,
|
||||
Font = OsuFont.GetFont(size: 12, weight: FontWeight.Bold),
|
||||
Y = 30,
|
||||
Font = OsuFont.GetFont(size: 16, weight: FontWeight.Regular),
|
||||
Text = @"back",
|
||||
},
|
||||
}
|
||||
@ -80,6 +83,8 @@ namespace osu.Game.Overlays
|
||||
|
||||
protected override void UpdateState()
|
||||
{
|
||||
base.UpdateState();
|
||||
|
||||
content.FadeColour(IsHovered ? ColourProvider.Light1 : ColourProvider.Light3, FADE_DURATION, Easing.OutQuint);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user