mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 09:22:54 +08:00
Clear content of SearchTextBox on first escape keypress.
This commit is contained in:
parent
bbf8d1000b
commit
937c065af7
@ -3,13 +3,10 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using OpenTK;
|
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
using OpenTK.Input;
|
using OpenTK.Input;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Primitives;
|
using osu.Framework.Graphics.Primitives;
|
||||||
using osu.Framework.Graphics.Sprites;
|
|
||||||
using osu.Framework.Graphics.UserInterface;
|
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
@ -66,7 +63,12 @@ namespace osu.Game.Screens.Select
|
|||||||
protected override void OnFocusLost(InputState state)
|
protected override void OnFocusLost(InputState state)
|
||||||
{
|
{
|
||||||
if (state.Keyboard.Keys.Any(key => key == Key.Escape))
|
if (state.Keyboard.Keys.Any(key => key == Key.Escape))
|
||||||
Exit?.Invoke();
|
{
|
||||||
|
if (Text.Length > 0)
|
||||||
|
Text = string.Empty;
|
||||||
|
else
|
||||||
|
Exit?.Invoke();
|
||||||
|
}
|
||||||
base.OnFocusLost(state);
|
base.OnFocusLost(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user