Fix overlay headers being blocked by loading layer

This commit is contained in:
Joseph Madamba 2023-03-20 22:26:51 -07:00
parent e1fb63e1f3
commit 74a15d7424
No known key found for this signature in database
GPG Key ID: 8B746C7BDDF0BD76

View File

@ -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,21 @@ 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();
loadingContainer.Padding = new MarginPadding { Top = Math.Max(0, Header.Height - ScrollFlow.Current) };
}
} }
} }