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

Ensure scroll-to-top button is displayed above all overlay content

This commit is contained in:
Dean Herbert 2023-05-17 15:42:38 +09:00
parent dc421bd2af
commit 79e1d978e7
3 changed files with 20 additions and 2 deletions

View File

@ -77,6 +77,14 @@ namespace osu.Game.Overlays
base.Content.Add(mainContent);
}
protected override void LoadComplete()
{
base.LoadComplete();
// Ensure the scroll-to-top button is displayed above the fixed header.
AddInternal(ScrollFlow.Button.CreateProxy());
}
protected override void UpdateAfterChildren()
{
base.UpdateAfterChildren();

View File

@ -31,7 +31,7 @@ namespace osu.Game.Overlays
/// </summary>
private const int button_scroll_position = 200;
protected ScrollBackButton Button;
public ScrollBackButton Button { get; private set; }
private readonly Bindable<float?> lastScrollTarget = new Bindable<float?>();

View File

@ -249,12 +249,14 @@ namespace osu.Game.Overlays
private partial class ProfileSectionsContainer : SectionsContainer<ProfileSection>
{
private OverlayScrollContainer scroll = null!;
public ProfileSectionsContainer()
{
RelativeSizeAxes = Axes.Both;
}
protected override UserTrackingScrollContainer CreateScrollContainer() => new OverlayScrollContainer();
protected override UserTrackingScrollContainer CreateScrollContainer() => scroll = new OverlayScrollContainer();
// Reverse child ID is required so expanding beatmap panels can appear above sections below them.
// This can also be done by setting Depth when adding new sections above if using ReverseChildID turns out to have any issues.
@ -267,6 +269,14 @@ namespace osu.Game.Overlays
Padding = new MarginPadding { Horizontal = 10 },
Margin = new MarginPadding { Bottom = 10 },
};
protected override void LoadComplete()
{
base.LoadComplete();
// Ensure the scroll-to-top button is displayed above the fixed header.
AddInternal(scroll.Button.CreateProxy());
}
}
}
}