Make OsuTextBox use OsuSpriteText.

This commit is contained in:
Dean Herbert
2017-02-08 11:19:58 +09:00
parent e720bed9e5
commit 5a89ba1040
2 changed files with 15 additions and 3 deletions

View File

@ -12,10 +12,11 @@ using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input;
using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Screens.Select
{
public class SearchTextBox : TextBox
public class SearchTextBox : OsuTextBox
{
protected override Color4 BackgroundUnfocused => new Color4(10, 10, 10, 255);
protected override Color4 BackgroundFocused => new Color4(10, 10, 10, 255);
@ -54,7 +55,6 @@ namespace osu.Game.Screens.Select
public SearchTextBox()
{
Height = 35;
TextContainer.Padding = new MarginPadding(5);
Add(new Drawable[]
{
placeholder = new SpriteText
@ -82,6 +82,13 @@ namespace osu.Game.Screens.Select
base.Update();
}
protected override bool OnFocus(InputState state)
{
var result = base.OnFocus(state);
BorderThickness = 0;
return result;
}
protected override void OnFocusLost(InputState state)
{
if (state.Keyboard.Keys.Any(key => key == Key.Escape))