1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 06:42:54 +08:00

Fix textbox focus issues (and inability to use escape).

This commit is contained in:
Dean Herbert 2017-05-01 15:23:01 +09:00
parent c1d0aea217
commit a1f341a64f
2 changed files with 7 additions and 3 deletions

View File

@ -13,6 +13,7 @@ using osu.Game.Graphics.UserInterface;
using osu.Game.Screens.Select;
using OpenTK;
using OpenTK.Graphics;
using System;
namespace osu.Game.Overlays.Music
{
@ -35,6 +36,7 @@ namespace osu.Game.Overlays.Music
{
RelativeSizeAxes = Axes.X,
Height = 40,
Exit = () => ExitRequested?.Invoke(),
},
new CollectionsDropdown<PlaylistCollection>
{
@ -46,6 +48,8 @@ namespace osu.Game.Overlays.Music
};
}
public Action ExitRequested;
public class FilterTextBox : SearchTextBox
{
protected override Color4 BackgroundUnfocused => OsuColour.FromHex(@"222222");

View File

@ -73,13 +73,14 @@ namespace osu.Game.Overlays.Music
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
ExitRequested = () => State = Visibility.Hidden,
Padding = new MarginPadding(10),
},
},
},
};
list.BeatmapSets = BeatmapSets = beatmaps.GetAllWithChildren<BeatmapSetInfo>().ToList();
beatmapBacking.BindTo(game.Beatmap);
@ -95,7 +96,7 @@ namespace osu.Game.Overlays.Music
protected override void PopIn()
{
filter.Search.HoldFocus = true;
filter.Search.TriggerFocus();
Schedule(() => filter.Search.TriggerFocus());
ResizeTo(new Vector2(1, playlist_height), transition_duration, EasingTypes.OutQuint);
FadeIn(transition_duration, EasingTypes.OutQuint);
@ -104,7 +105,6 @@ namespace osu.Game.Overlays.Music
protected override void PopOut()
{
filter.Search.HoldFocus = false;
filter.Search.TriggerFocusLost();
ResizeTo(new Vector2(1, 0), transition_duration, EasingTypes.OutQuint);
FadeOut(transition_duration);