mirror of
https://github.com/ppy/osu
synced 2025-01-10 08:09:40 +00:00
Proper search field focusing and exit on escape
This commit is contained in:
parent
a88c82705b
commit
7f2feab9e7
@ -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<T> : OsuDropdown<T>
|
||||
@ -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,
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user