1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-20 06:00:25 +08:00

Use enum for background states

This commit is contained in:
Dean Herbert
2026-01-27 18:58:03 +09:00
Unverified
parent 12eeab581e
commit fa22d1f202
8 changed files with 93 additions and 62 deletions
@@ -185,9 +185,14 @@ namespace osu.Game.Graphics.UserInterfaceV2
caption.Colour = disabled ? colourProvider.Background1 : colourProvider.Content2;
textBox.Colour = disabled ? colourProvider.Foreground1 : colourProvider.Content1;
background.StyleDisabled = Current.Disabled;
background.StyleFocused = textBox.Focused.Value;
background.StyleHovered = IsHovered;
if (Current.Disabled)
background.VisualStyle = VisualStyle.Disabled;
else if (textBox.Focused.Value)
background.VisualStyle = VisualStyle.Focused;
else if (IsHovered)
background.VisualStyle = VisualStyle.Hovered;
else
background.VisualStyle = VisualStyle.Normal;
}
internal partial class InnerTextBox : OsuTextBox