mirror of
https://github.com/ppy/osu.git
synced 2025-03-28 09:37:23 +08:00
Merge pull request #8820 from peppy/fix-beatmap-listing-focus
Fix BeatmapListingOverlay not taking focus
This commit is contained in:
commit
5f60071541
@ -159,5 +159,7 @@ namespace osu.Game.Overlays.BeatmapListing
|
|||||||
|
|
||||||
base.Dispose(isDisposing);
|
base.Dispose(isDisposing);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void TakeFocus() => searchControl.TakeFocus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -121,6 +121,8 @@ namespace osu.Game.Overlays.BeatmapListing
|
|||||||
background.Colour = colourProvider.Dark6;
|
background.Colour = colourProvider.Dark6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void TakeFocus() => textBox.TakeFocus();
|
||||||
|
|
||||||
private class BeatmapSearchTextBox : SearchTextBox
|
private class BeatmapSearchTextBox : SearchTextBox
|
||||||
{
|
{
|
||||||
protected override Color4 SelectionColour => Color4.Gray;
|
protected override Color4 SelectionColour => Color4.Gray;
|
||||||
|
@ -10,6 +10,7 @@ using osu.Framework.Graphics.Containers;
|
|||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Graphics.Textures;
|
using osu.Framework.Graphics.Textures;
|
||||||
|
using osu.Framework.Input.Events;
|
||||||
using osu.Game.Audio;
|
using osu.Game.Audio;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
@ -35,6 +36,8 @@ namespace osu.Game.Overlays
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private BeatmapListingFilterControl filterControl;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
@ -57,7 +60,7 @@ namespace osu.Game.Overlays
|
|||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new BeatmapListingHeader(),
|
new BeatmapListingHeader(),
|
||||||
new BeatmapListingFilterControl
|
filterControl = new BeatmapListingFilterControl
|
||||||
{
|
{
|
||||||
SearchStarted = onSearchStarted,
|
SearchStarted = onSearchStarted,
|
||||||
SearchFinished = onSearchFinished,
|
SearchFinished = onSearchFinished,
|
||||||
@ -88,6 +91,13 @@ namespace osu.Game.Overlays
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void OnFocus(FocusEvent e)
|
||||||
|
{
|
||||||
|
base.OnFocus(e);
|
||||||
|
|
||||||
|
filterControl.TakeFocus();
|
||||||
|
}
|
||||||
|
|
||||||
private CancellationTokenSource cancellationToken;
|
private CancellationTokenSource cancellationToken;
|
||||||
|
|
||||||
private void onSearchStarted()
|
private void onSearchStarted()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user