mirror of
https://github.com/ppy/osu
synced 2025-02-21 21:17:13 +00:00
Merge pull request #26618 from frenzibyte/fix-revert-to-default-epic-fail
Fix revert-to-default button appearing on disabled settings regardless of value
This commit is contained in:
commit
5123186c23
@ -40,8 +40,15 @@ namespace osu.Game.Tests.Visual.Settings
|
||||
AddStep("change value from default", () => textBox.Current.Value = "non-default");
|
||||
AddUntilStep("restore button shown", () => revertToDefaultButton.Alpha > 0);
|
||||
|
||||
AddStep("disable setting", () => textBox.Current.Disabled = true);
|
||||
AddUntilStep("restore button still shown", () => revertToDefaultButton.Alpha > 0);
|
||||
|
||||
AddStep("enable setting", () => textBox.Current.Disabled = false);
|
||||
AddStep("restore default", () => textBox.Current.SetDefault());
|
||||
AddUntilStep("restore button hidden", () => revertToDefaultButton.Alpha == 0);
|
||||
|
||||
AddStep("disable setting", () => textBox.Current.Disabled = true);
|
||||
AddUntilStep("restore button still hidden", () => revertToDefaultButton.Alpha == 0);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -115,7 +115,12 @@ namespace osu.Game.Overlays
|
||||
|
||||
Enabled.Value = !current.Disabled;
|
||||
|
||||
this.FadeTo(current.Disabled ? 0.2f : (current.IsDefault ? 0 : 1), fade_duration, Easing.OutQuint);
|
||||
if (current.IsDefault)
|
||||
this.FadeTo(0, fade_duration, Easing.OutQuint);
|
||||
else if (current.Disabled)
|
||||
this.FadeTo(0.2f, fade_duration, Easing.OutQuint);
|
||||
else
|
||||
this.FadeTo(1, fade_duration, Easing.OutQuint);
|
||||
|
||||
if (IsHovered && Enabled.Value)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user