1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-21 17:17:20 +08:00

Merge pull request #9534 from Joehuu/fix-color/underline-tab-control-checkbox

This commit is contained in:
Dean Herbert 2020-07-12 12:59:23 +09:00 committed by GitHub
commit a812b8e7fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,7 +21,6 @@ namespace osu.Game.Graphics.UserInterface
{
private readonly Box box;
private readonly SpriteText text;
private readonly SpriteIcon icon;
private Color4? accentColour;
@ -32,12 +31,6 @@ namespace osu.Game.Graphics.UserInterface
{
accentColour = value;
if (Current.Value)
{
text.Colour = AccentColour;
icon.Colour = AccentColour;
}
updateFade();
}
}
@ -52,6 +45,8 @@ namespace osu.Game.Graphics.UserInterface
public OsuTabControlCheckbox()
{
SpriteIcon icon;
AutoSizeAxes = Axes.Both;
Children = new Drawable[]
@ -89,6 +84,8 @@ namespace osu.Game.Graphics.UserInterface
{
icon.Icon = selected.NewValue ? FontAwesome.Regular.CheckCircle : FontAwesome.Regular.Circle;
text.Font = text.Font.With(weight: selected.NewValue ? FontWeight.Bold : FontWeight.Medium);
updateFade();
};
}
@ -115,8 +112,8 @@ namespace osu.Game.Graphics.UserInterface
private void updateFade()
{
box.FadeTo(IsHovered ? 1 : 0, transition_length, Easing.OutQuint);
text.FadeColour(IsHovered ? Color4.White : AccentColour, transition_length, Easing.OutQuint);
box.FadeTo(Current.Value || IsHovered ? 1 : 0, transition_length, Easing.OutQuint);
text.FadeColour(Current.Value || IsHovered ? Color4.White : AccentColour, transition_length, Easing.OutQuint);
}
}
}