mirror of
https://github.com/ppy/osu
synced 2025-01-10 08:09:40 +00:00
Merge pull request #14937 from Susko3/fix-keybinds-reset-search
Fix 'Reset all bindings in section' button appearing when it shouldn't during searches
This commit is contained in:
commit
ea7334f121
@ -7,6 +7,7 @@ using NUnit.Framework;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Framework.Threading;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Overlays.Settings.Sections.Input;
|
||||
using osuTK.Input;
|
||||
@ -230,6 +231,22 @@ namespace osu.Game.Tests.Visual.Settings
|
||||
AddAssert("first binding selected", () => multiBindingRow.ChildrenOfType<KeyBindingRow.KeyButton>().First().IsBinding);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestFilteringHidesResetSectionButtons()
|
||||
{
|
||||
SearchTextBox searchTextBox = null;
|
||||
|
||||
AddStep("add any search term", () =>
|
||||
{
|
||||
searchTextBox = panel.ChildrenOfType<SearchTextBox>().Single();
|
||||
searchTextBox.Current.Value = "chat";
|
||||
});
|
||||
AddUntilStep("all reset section bindings buttons hidden", () => panel.ChildrenOfType<ResetButton>().All(button => button.Alpha == 0));
|
||||
|
||||
AddStep("clear search term", () => searchTextBox.Current.Value = string.Empty);
|
||||
AddUntilStep("all reset section bindings buttons shown", () => panel.ChildrenOfType<ResetButton>().All(button => button.Alpha == 1));
|
||||
}
|
||||
|
||||
private void checkBinding(string name, string keyName)
|
||||
{
|
||||
AddAssert($"Check {name} is bound to {keyName}", () =>
|
||||
|
@ -75,5 +75,8 @@ namespace osu.Game.Overlays.Settings.Sections.Input
|
||||
|
||||
Content.CornerRadius = 5;
|
||||
}
|
||||
|
||||
// Empty FilterTerms so that the ResetButton is visible only when the whole subsection is visible.
|
||||
public override IEnumerable<string> FilterTerms => Enumerable.Empty<string>();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user