1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 04:02:59 +08:00

Assign an explicit depth when reordering.

This commit is contained in:
Huo Yaoyuan 2017-06-22 20:23:49 +08:00
parent bcfb1392d7
commit 1d4add9079

View File

@ -115,10 +115,16 @@ namespace osu.Game.Overlays
{ {
header.FillFullData(u); header.FillFullData(u);
var reorderedSections = u.ProfileOrder.Select(x => sections.FirstOrDefault(s => s.Identifier == x)).Where(s => s != null).ToList(); for (int i = 0; i < u.ProfileOrder.Length; i++)
{
sectionsContainer.Children = reorderedSections; var sec = sections.FirstOrDefault(s => s.Identifier == u.ProfileOrder[i]);
reorderedSections.ForEach(tabs.AddItem); if (sec != null)
{
sec.Depth = -i;
sectionsContainer.Add(sec);
tabs.AddItem(sec);
}
}
}; };
api.Queue(userReq); api.Queue(userReq);