1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 06:17:23 +08:00

Update focus requesting code in SearchTextBox.

This commit is contained in:
Dean Herbert 2017-02-08 15:13:56 +09:00
parent 5eb3ef3948
commit bbf8d1000b
No known key found for this signature in database
GPG Key ID: 46D71BF4958ABB49

View File

@ -16,6 +16,9 @@ using osu.Game.Graphics.UserInterface;
namespace osu.Game.Screens.Select
{
/// <summary>
/// A textbox which holds focus eagerly.
/// </summary>
public class SearchTextBox : OsuTextBox
{
protected override Color4 BackgroundUnfocused => new Color4(10, 10, 10, 255);
@ -34,6 +37,8 @@ namespace osu.Game.Screens.Select
}
}
public override bool RequestingFocus => HoldFocus;
public SearchTextBox()
{
Height = 35;
@ -51,12 +56,6 @@ namespace osu.Game.Screens.Select
PlaceholderText = "type to search";
}
protected override void Update()
{
if (HoldFocus) RequestFocus();
base.Update();
}
protected override bool OnFocus(InputState state)
{
var result = base.OnFocus(state);