mirror of
https://github.com/ppy/osu.git
synced 2025-03-21 21:37:45 +08:00
Merge pull request #9534 from Joehuu/fix-color/underline-tab-control-checkbox
This commit is contained in:
commit
a812b8e7fd
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user