mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 10:43:04 +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();
|
createScreen();
|
||||||
|
|
||||||
AddStep("click on mod column", navigateAndClick<ModColumn>);
|
|
||||||
AddAssert("lost focus", () => !modSelectOverlay.SearchTextBox.HasFocus);
|
|
||||||
|
|
||||||
AddStep("click on search", navigateAndClick<ShearedSearchTextBox>);
|
AddStep("click on search", navigateAndClick<ShearedSearchTextBox>);
|
||||||
AddAssert("focused", () => modSelectOverlay.SearchTextBox.HasFocus);
|
AddAssert("focused", () => modSelectOverlay.SearchTextBox.HasFocus);
|
||||||
|
|
||||||
|
AddStep("click on mod column", navigateAndClick<ModColumn>);
|
||||||
|
AddAssert("lost focus", () => !modSelectOverlay.SearchTextBox.HasFocus);
|
||||||
|
|
||||||
void navigateAndClick<T>() where T : Drawable
|
void navigateAndClick<T>() where T : Drawable
|
||||||
{
|
{
|
||||||
InputManager.MoveMouseTo(modSelectOverlay.ChildrenOfType<T>().FirstOrDefault());
|
InputManager.MoveMouseTo(modSelectOverlay.ChildrenOfType<T>().FirstOrDefault());
|
||||||
@ -571,10 +571,10 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
const Key focus_switch_key = Key.Tab;
|
const Key focus_switch_key = Key.Tab;
|
||||||
|
|
||||||
AddStep("press tab", () => InputManager.Key(focus_switch_key));
|
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));
|
AddStep("press tab", () => InputManager.Key(focus_switch_key));
|
||||||
AddAssert("focused", () => modSelectOverlay.SearchTextBox.HasFocus);
|
AddAssert("lost focus", () => !modSelectOverlay.SearchTextBox.HasFocus);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@ -500,8 +500,6 @@ namespace osu.Game.Overlays.Mods
|
|||||||
|
|
||||||
base.PopIn();
|
base.PopIn();
|
||||||
|
|
||||||
SearchTextBox.TakeFocus();
|
|
||||||
|
|
||||||
aboveColumnsContent
|
aboveColumnsContent
|
||||||
.FadeIn(fade_in_duration, Easing.OutQuint)
|
.FadeIn(fade_in_duration, Easing.OutQuint)
|
||||||
.MoveToY(0, fade_in_duration, Easing.OutQuint);
|
.MoveToY(0, fade_in_duration, Easing.OutQuint);
|
||||||
|
Loading…
Reference in New Issue
Block a user