diff --git a/osu.Desktop.Tests/Visual/TestCaseUserRanks.cs b/osu.Desktop.Tests/Visual/TestCaseUserRanks.cs index 867e62859d..41f3a37e94 100644 --- a/osu.Desktop.Tests/Visual/TestCaseUserRanks.cs +++ b/osu.Desktop.Tests/Visual/TestCaseUserRanks.cs @@ -16,13 +16,14 @@ using System.Collections.Generic; namespace osu.Desktop.Tests.Visual { - public class TestCaseUserRanks : TestCase + internal class TestCaseUserRanks : TestCase { public override string Description => "showing your latest achievements"; protected override void LoadComplete() { base.LoadComplete(); + RanksSection ranks; Add(new Container diff --git a/osu.Game/Overlays/Profile/Sections/RanksSection.cs b/osu.Game/Overlays/Profile/Sections/RanksSection.cs index 2d8da5b1f0..f6590140ec 100644 --- a/osu.Game/Overlays/Profile/Sections/RanksSection.cs +++ b/osu.Game/Overlays/Profile/Sections/RanksSection.cs @@ -136,19 +136,6 @@ namespace osu.Game.Overlays.Profile.Sections RelativeSizeAxes = Axes.X, Direction = FillDirection.Vertical, }, - showMoreText = new OsuHoverContainer - { - Action = ShowMore, - AutoSizeAxes = Axes.Both, - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, - Alpha = 0, - Child = new OsuSpriteText - { - TextSize = 14, - Text = "show more", - } - } }, }; } @@ -156,7 +143,21 @@ namespace osu.Game.Overlays.Profile.Sections public override void Clear(bool disposeChildren) { base.Clear(disposeChildren); - showMoreText.Show(); + if (showMoreText == null) + ((FillFlowContainer)InternalChild).Add(showMoreText = new OsuHoverContainer + { + Action = ShowMore, + AutoSizeAxes = Axes.Both, + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + Child = new OsuSpriteText + { + TextSize = 14, + Text = "show more", + } + }); + else + showMoreText.Show(); } public void ShowMore() => showMoreText.Alpha = Children.Where(d => !d.IsPresent).Where((d, i) => (d.Alpha = i < 5 ? 1 : 0) == 0).Any() ? 1 : 0;