1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 15:12:57 +08:00

Set the hover background colour as dictated by flyte

This commit is contained in:
smoogipoo 2017-09-29 15:09:56 +09:00
parent 6bb5210c7c
commit b2eab1f435

View File

@ -41,9 +41,6 @@ namespace osu.Game.Screens.Edit.Menus
private class DrawableEditorBarMenuItem : DrawableOsuMenuItem private class DrawableEditorBarMenuItem : DrawableOsuMenuItem
{ {
private Color4 openedForegroundColour;
private Color4 openedBackgroundColour;
public DrawableEditorBarMenuItem(MenuItem item) public DrawableEditorBarMenuItem(MenuItem item)
: base(item) : base(item)
@ -52,24 +49,24 @@ namespace osu.Game.Screens.Edit.Menus
Origin = Anchor.CentreLeft; Origin = Anchor.CentreLeft;
} }
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
ForegroundColour = colours.BlueLight;
BackgroundColour = Color4.Transparent;
ForegroundColourHover = Color4.White;
BackgroundColourHover = colours.Gray3;
}
public override void SetFlowDirection(Direction direction) public override void SetFlowDirection(Direction direction)
{ {
AutoSizeAxes = Axes.Both; AutoSizeAxes = Axes.Both;
} }
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
ForegroundColour = ForegroundColourHover = colours.BlueLight;
BackgroundColour = BackgroundColourHover = Color4.Transparent;
openedForegroundColour = Color4.White;
openedBackgroundColour = colours.Gray3;
}
protected override void UpdateBackgroundColour() protected override void UpdateBackgroundColour()
{ {
if (State == MenuItemState.Selected) if (State == MenuItemState.Selected)
Background.FadeColour(openedBackgroundColour); Background.FadeColour(BackgroundColourHover);
else else
base.UpdateBackgroundColour(); base.UpdateBackgroundColour();
} }
@ -77,7 +74,7 @@ namespace osu.Game.Screens.Edit.Menus
protected override void UpdateForegroundColour() protected override void UpdateForegroundColour()
{ {
if (State == MenuItemState.Selected) if (State == MenuItemState.Selected)
Foreground.FadeColour(openedForegroundColour); Foreground.FadeColour(ForegroundColourHover);
else else
base.UpdateForegroundColour(); base.UpdateForegroundColour();
} }