1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-07 20:07:24 +08:00

Merge pull request #22929 from Joehuu/fix-loading-blocking-overlay-headers

Fix beatmap listing filter control being blocked by loading layer
This commit is contained in:
Dean Herbert 2023-04-03 15:29:38 +09:00 committed by GitHub
commit e4eb736622
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 8 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,8 @@ namespace osu.Game.Overlays
private Container panelTarget;
private FillFlowContainer<BeatmapCard> foundContent;
private BeatmapListingFilterControl filterControl;
private BeatmapListingFilterControl filterControl => Header.FilterControl;
public BeatmapListingOverlay()
: base(OverlayColourScheme.Blue)
@ -60,12 +61,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,
@ -88,6 +83,10 @@ namespace osu.Game.Overlays
},
}
};
filterControl.TypingStarted = onTypingStarted;
filterControl.SearchStarted = onSearchStarted;
filterControl.SearchFinished = onSearchFinished;
}
protected override void LoadComplete()

View File

@ -3,6 +3,7 @@
#nullable disable
using System;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
@ -22,6 +23,7 @@ namespace osu.Game.Overlays
protected readonly OverlayScrollContainer ScrollFlow;
protected readonly LoadingLayer Loading;
private readonly Container loadingContainer;
private readonly Container content;
protected OnlineOverlay(OverlayColourScheme colourScheme, bool requiresSignIn = true)
@ -65,10 +67,22 @@ namespace osu.Game.Overlays
},
}
},
Loading = new LoadingLayer(true)
loadingContainer = new Container
{
RelativeSizeAxes = Axes.Both,
Child = Loading = new LoadingLayer(true),
}
});
base.Content.Add(mainContent);
}
protected override void UpdateAfterChildren()
{
base.UpdateAfterChildren();
// don't block header by applying padding equal to the visible header height
loadingContainer.Padding = new MarginPadding { Top = Math.Max(0, Header.Height - ScrollFlow.Current) };
}
}
}