diff --git a/osu.Game/Graphics/UserInterface/OsuCheckbox.cs b/osu.Game/Graphics/UserInterface/OsuCheckbox.cs index d339388aa5..e81db4954e 100644 --- a/osu.Game/Graphics/UserInterface/OsuCheckbox.cs +++ b/osu.Game/Graphics/UserInterface/OsuCheckbox.cs @@ -25,8 +25,6 @@ namespace osu.Game.Graphics.UserInterface { bindable = value; Current.BindTo(bindable); - if (value?.Disabled ?? true) - Alpha = 0.3f; } } @@ -84,6 +82,11 @@ namespace osu.Game.Graphics.UserInterface else sampleUnchecked?.Play(); }; + + Current.DisabledChanged += disabled => + { + Alpha = disabled ? 0.3f : 1; + }; } protected override bool OnHover(InputState state) diff --git a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs index 6d36c1a585..9b9a774049 100644 --- a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs +++ b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs @@ -74,6 +74,11 @@ namespace osu.Game.Graphics.UserInterface Expanded = true, } }; + + Current.DisabledChanged += disabled => + { + Alpha = disabled ? 0.3f : 1; + }; } [BackgroundDependencyLoader] diff --git a/osu.Game/Graphics/UserInterface/OsuTextBox.cs b/osu.Game/Graphics/UserInterface/OsuTextBox.cs index a54b122615..62b10b96ef 100644 --- a/osu.Game/Graphics/UserInterface/OsuTextBox.cs +++ b/osu.Game/Graphics/UserInterface/OsuTextBox.cs @@ -33,6 +33,11 @@ namespace osu.Game.Graphics.UserInterface Height = 40; TextContainer.Height = 0.5f; CornerRadius = 5; + + Current.DisabledChanged += disabled => + { + Alpha = disabled ? 0.3f : 1; + }; } [BackgroundDependencyLoader] diff --git a/osu.Game/Overlays/Options/OptionDropdown.cs b/osu.Game/Overlays/Options/OptionDropdown.cs index ee12ba9b05..8642b132df 100644 --- a/osu.Game/Overlays/Options/OptionDropdown.cs +++ b/osu.Game/Overlays/Options/OptionDropdown.cs @@ -34,8 +34,6 @@ namespace osu.Game.Overlays.Options { bindable = value; dropdown.Current.BindTo(bindable); - if (value?.Disabled ?? true) - Alpha = 0.3f; } } @@ -75,6 +73,11 @@ namespace osu.Game.Overlays.Options Items = Items, } }; + + dropdown.Current.DisabledChanged += disabled => + { + Alpha = disabled ? 0.3f : 1; + }; } } } diff --git a/osu.Game/Overlays/Options/OptionSlider.cs b/osu.Game/Overlays/Options/OptionSlider.cs index 1c4b54a080..5c383c74a8 100644 --- a/osu.Game/Overlays/Options/OptionSlider.cs +++ b/osu.Game/Overlays/Options/OptionSlider.cs @@ -35,8 +35,6 @@ namespace osu.Game.Overlays.Options { bindable = value; slider.Current.BindTo(bindable); - if (value?.Disabled ?? true) - Alpha = 0.3f; } } diff --git a/osu.Game/Overlays/Options/OptionTextBox.cs b/osu.Game/Overlays/Options/OptionTextBox.cs index b5ef39c8b2..4927122181 100644 --- a/osu.Game/Overlays/Options/OptionTextBox.cs +++ b/osu.Game/Overlays/Options/OptionTextBox.cs @@ -16,9 +16,7 @@ namespace osu.Game.Overlays.Options { bindable = value; Current.BindTo(bindable); - if (value?.Disabled ?? true) - Alpha = 0.3f; } } } -} \ No newline at end of file +}