mirror of
https://github.com/ppy/osu.git
synced 2024-11-07 22:27:25 +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:
commit
e4eb736622
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Localisation;
|
using osu.Game.Localisation;
|
||||||
using osu.Game.Resources.Localisation.Web;
|
using osu.Game.Resources.Localisation.Web;
|
||||||
|
|
||||||
@ -10,8 +11,12 @@ namespace osu.Game.Overlays.BeatmapListing
|
|||||||
{
|
{
|
||||||
public partial class BeatmapListingHeader : OverlayHeader
|
public partial class BeatmapListingHeader : OverlayHeader
|
||||||
{
|
{
|
||||||
|
public BeatmapListingFilterControl FilterControl { get; private set; }
|
||||||
|
|
||||||
protected override OverlayTitle CreateTitle() => new BeatmapListingTitle();
|
protected override OverlayTitle CreateTitle() => new BeatmapListingTitle();
|
||||||
|
|
||||||
|
protected override Drawable CreateContent() => FilterControl = new BeatmapListingFilterControl();
|
||||||
|
|
||||||
private partial class BeatmapListingTitle : OverlayTitle
|
private partial class BeatmapListingTitle : OverlayTitle
|
||||||
{
|
{
|
||||||
public BeatmapListingTitle()
|
public BeatmapListingTitle()
|
||||||
|
@ -43,7 +43,8 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
private Container panelTarget;
|
private Container panelTarget;
|
||||||
private FillFlowContainer<BeatmapCard> foundContent;
|
private FillFlowContainer<BeatmapCard> foundContent;
|
||||||
private BeatmapListingFilterControl filterControl;
|
|
||||||
|
private BeatmapListingFilterControl filterControl => Header.FilterControl;
|
||||||
|
|
||||||
public BeatmapListingOverlay()
|
public BeatmapListingOverlay()
|
||||||
: base(OverlayColourScheme.Blue)
|
: base(OverlayColourScheme.Blue)
|
||||||
@ -60,12 +61,6 @@ namespace osu.Game.Overlays
|
|||||||
Direction = FillDirection.Vertical,
|
Direction = FillDirection.Vertical,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
filterControl = new BeatmapListingFilterControl
|
|
||||||
{
|
|
||||||
TypingStarted = onTypingStarted,
|
|
||||||
SearchStarted = onSearchStarted,
|
|
||||||
SearchFinished = onSearchFinished,
|
|
||||||
},
|
|
||||||
new Container
|
new Container
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Y,
|
AutoSizeAxes = Axes.Y,
|
||||||
@ -88,6 +83,10 @@ namespace osu.Game.Overlays
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
filterControl.TypingStarted = onTypingStarted;
|
||||||
|
filterControl.SearchStarted = onSearchStarted;
|
||||||
|
filterControl.SearchFinished = onSearchFinished;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
|
using System;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
@ -22,6 +23,7 @@ namespace osu.Game.Overlays
|
|||||||
protected readonly OverlayScrollContainer ScrollFlow;
|
protected readonly OverlayScrollContainer ScrollFlow;
|
||||||
|
|
||||||
protected readonly LoadingLayer Loading;
|
protected readonly LoadingLayer Loading;
|
||||||
|
private readonly Container loadingContainer;
|
||||||
private readonly Container content;
|
private readonly Container content;
|
||||||
|
|
||||||
protected OnlineOverlay(OverlayColourScheme colourScheme, bool requiresSignIn = true)
|
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);
|
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) };
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user