mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 19:02:57 +08:00
Update focus requesting code in SearchTextBox.
This commit is contained in:
parent
5eb3ef3948
commit
bbf8d1000b
@ -16,6 +16,9 @@ using osu.Game.Graphics.UserInterface;
|
|||||||
|
|
||||||
namespace osu.Game.Screens.Select
|
namespace osu.Game.Screens.Select
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// A textbox which holds focus eagerly.
|
||||||
|
/// </summary>
|
||||||
public class SearchTextBox : OsuTextBox
|
public class SearchTextBox : OsuTextBox
|
||||||
{
|
{
|
||||||
protected override Color4 BackgroundUnfocused => new Color4(10, 10, 10, 255);
|
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()
|
public SearchTextBox()
|
||||||
{
|
{
|
||||||
Height = 35;
|
Height = 35;
|
||||||
@ -51,12 +56,6 @@ namespace osu.Game.Screens.Select
|
|||||||
PlaceholderText = "type to search";
|
PlaceholderText = "type to search";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Update()
|
|
||||||
{
|
|
||||||
if (HoldFocus) RequestFocus();
|
|
||||||
base.Update();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override bool OnFocus(InputState state)
|
protected override bool OnFocus(InputState state)
|
||||||
{
|
{
|
||||||
var result = base.OnFocus(state);
|
var result = base.OnFocus(state);
|
||||||
|
Loading…
Reference in New Issue
Block a user