mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 09:27:29 +08:00
Switch search box to initially unfocused
Done primarily to keep mod hotkeys working without any behavioural changes when mod select is opened.
This commit is contained in:
parent
9ba4bf5fb7
commit
75300ca229
@ -550,12 +550,12 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
{
|
||||
createScreen();
|
||||
|
||||
AddStep("click on mod column", navigateAndClick<ModColumn>);
|
||||
AddAssert("lost focus", () => !modSelectOverlay.SearchTextBox.HasFocus);
|
||||
|
||||
AddStep("click on search", navigateAndClick<ShearedSearchTextBox>);
|
||||
AddAssert("focused", () => modSelectOverlay.SearchTextBox.HasFocus);
|
||||
|
||||
AddStep("click on mod column", navigateAndClick<ModColumn>);
|
||||
AddAssert("lost focus", () => !modSelectOverlay.SearchTextBox.HasFocus);
|
||||
|
||||
void navigateAndClick<T>() where T : Drawable
|
||||
{
|
||||
InputManager.MoveMouseTo(modSelectOverlay.ChildrenOfType<T>().FirstOrDefault());
|
||||
@ -571,10 +571,10 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
const Key focus_switch_key = Key.Tab;
|
||||
|
||||
AddStep("press tab", () => InputManager.Key(focus_switch_key));
|
||||
AddAssert("lost focus", () => !modSelectOverlay.SearchTextBox.HasFocus);
|
||||
AddAssert("focused", () => modSelectOverlay.SearchTextBox.HasFocus);
|
||||
|
||||
AddStep("press tab", () => InputManager.Key(focus_switch_key));
|
||||
AddAssert("focused", () => modSelectOverlay.SearchTextBox.HasFocus);
|
||||
AddAssert("lost focus", () => !modSelectOverlay.SearchTextBox.HasFocus);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -500,8 +500,6 @@ namespace osu.Game.Overlays.Mods
|
||||
|
||||
base.PopIn();
|
||||
|
||||
SearchTextBox.TakeFocus();
|
||||
|
||||
aboveColumnsContent
|
||||
.FadeIn(fade_in_duration, Easing.OutQuint)
|
||||
.MoveToY(0, fade_in_duration, Easing.OutQuint);
|
||||
|
Loading…
Reference in New Issue
Block a user