From 7f2feab9e7980ab9a1b8041a281b075f484babd7 Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Sun, 9 Apr 2017 06:26:17 -0300 Subject: [PATCH] Proper search field focusing and exit on escape --- osu.Game/Overlays/PlaylistController.cs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/osu.Game/Overlays/PlaylistController.cs b/osu.Game/Overlays/PlaylistController.cs index 797ac1147a..c7a538454d 100644 --- a/osu.Game/Overlays/PlaylistController.cs +++ b/osu.Game/Overlays/PlaylistController.cs @@ -20,7 +20,7 @@ using osu.Game.Screens.Select; namespace osu.Game.Overlays { - public class PlaylistController : FocusedOverlayContainer + public class PlaylistController : OverlayContainer { private const float transition_duration = 800; @@ -83,6 +83,8 @@ namespace osu.Game.Overlays }, }, }; + + filter.Search.Exit = Hide; } [BackgroundDependencyLoader] @@ -94,9 +96,8 @@ namespace osu.Game.Overlays protected override void PopIn() { - base.PopIn(); - filter.Search.HoldFocus = true; + filter.Search.TriggerFocus(); list.ScrollContainer.ScrollDraggerVisible = true; ResizeTo(new Vector2(1f), transition_duration, EasingTypes.OutQuint); @@ -104,8 +105,6 @@ namespace osu.Game.Overlays protected override void PopOut() { - base.PopOut(); - filter.Search.HoldFocus = false; filter.Search.TriggerFocusLost(); @@ -143,7 +142,7 @@ namespace osu.Game.Overlays }; } - public class FilterTextBox : SearchTextBox + public class FilterTextBox : SearchTextBox { protected override Color4 BackgroundUnfocused => OsuColour.FromHex(@"222222"); protected override Color4 BackgroundFocused => OsuColour.FromHex(@"222222"); @@ -152,7 +151,7 @@ namespace osu.Game.Overlays { Masking = true; CornerRadius = 5; - } + } } private class CollectionsDropdown : OsuDropdown @@ -234,8 +233,8 @@ namespace osu.Game.Overlays for (int i = 0; i < value.Length; i++) { - newItems.Add(new PlaylistItem(value[i], i) - { + newItems.Add(new PlaylistItem(value[i], i) + { OnSelect = OnSelect, }); }