diff --git a/osu.Game/Overlays/DirectOverlay.cs b/osu.Game/Overlays/DirectOverlay.cs index 02ea4694c1..5dcad5e8d0 100644 --- a/osu.Game/Overlays/DirectOverlay.cs +++ b/osu.Game/Overlays/DirectOverlay.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; +using System.Linq; using OpenTK; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -81,7 +82,7 @@ namespace osu.Game.Overlays Padding = new MarginPadding { Top = Header.HEIGHT }, Children = new Drawable[] { - new FillFlowContainer + new ContentFlow { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, @@ -118,7 +119,7 @@ namespace osu.Game.Overlays var p = new List(); foreach (BeatmapSetInfo b in BeatmapSets) - p.Add(displayStyle == PanelDisplayStyle.Grid ? (DirectPanel)(new DirectGridPanel(b) { Width = 400}) : + p.Add(displayStyle == PanelDisplayStyle.Grid ? (DirectPanel)(new DirectGridPanel(b) { Width = 400 }) : (DirectPanel)(new DirectListPanel(b))); panels.Children = p; @@ -138,5 +139,16 @@ namespace osu.Game.Overlays filter.Search.HoldFocus = false; } + + private class ContentFlow : FillFlowContainer + { + protected override IComparer DepthComparer => new ReverseCreationOrderDepthComparer(); + protected override IEnumerable FlowingChildren => base.FlowingChildren.Reverse(); + + public ContentFlow() + { + Direction = FillDirection.Vertical; + } + } } }