1
0
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:
Bartłomiej Dach 2023-06-18 15:50:25 +02:00
parent 9ba4bf5fb7
commit 75300ca229
No known key found for this signature in database
2 changed files with 5 additions and 7 deletions

View File

@ -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]

View File

@ -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);