1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-26 12:45:09 +08:00

Merge pull request #23580 from peppy/fix-profile-button-depth

Ensure scroll-to-top button is displayed above all overlay content
This commit is contained in:
Bartłomiej Dach 2023-05-17 21:23:46 +02:00 committed by GitHub
commit 9ca1c7f7b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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());
}
}
}
}