Move beatmap listing filter control to header

This commit is contained in:
Joseph Madamba 2023-03-20 22:27:07 -07:00
parent 7c1ccefa4a
commit e1fb63e1f3
No known key found for this signature in database
GPG Key ID: 8B746C7BDDF0BD76
2 changed files with 12 additions and 7 deletions

View File

@ -3,6 +3,7 @@
#nullable disable
using osu.Framework.Graphics;
using osu.Game.Localisation;
using osu.Game.Resources.Localisation.Web;
@ -10,8 +11,12 @@ namespace osu.Game.Overlays.BeatmapListing
{
public partial class BeatmapListingHeader : OverlayHeader
{
public BeatmapListingFilterControl FilterControl { get; private set; }
protected override OverlayTitle CreateTitle() => new BeatmapListingTitle();
protected override Drawable CreateContent() => FilterControl = new BeatmapListingFilterControl();
private partial class BeatmapListingTitle : OverlayTitle
{
public BeatmapListingTitle()

View File

@ -43,7 +43,13 @@ namespace osu.Game.Overlays
private Container panelTarget;
private FillFlowContainer<BeatmapCard> foundContent;
private BeatmapListingFilterControl filterControl;
private BeatmapListingFilterControl filterControl => Header.FilterControl.With(f =>
{
f.TypingStarted = onTypingStarted;
f.SearchStarted = onSearchStarted;
f.SearchFinished = onSearchFinished;
});
public BeatmapListingOverlay()
: base(OverlayColourScheme.Blue)
@ -60,12 +66,6 @@ namespace osu.Game.Overlays
Direction = FillDirection.Vertical,
Children = new Drawable[]
{
filterControl = new BeatmapListingFilterControl
{
TypingStarted = onTypingStarted,
SearchStarted = onSearchStarted,
SearchFinished = onSearchFinished,
},
new Container
{
AutoSizeAxes = Axes.Y,