Add ReverseDepthFillFlowContainer to remove code duplication

This commit is contained in:
DrabWeb
2017-05-19 23:44:36 -03:00
parent 68cb23786a
commit e030573436
4 changed files with 21 additions and 26 deletions

View File

@ -10,6 +10,7 @@ using osu.Framework.Graphics.Sprites;
using osu.Game.Database;
using osu.Game.Graphics;
using osu.Game.Graphics.Backgrounds;
using osu.Game.Graphics.Containers;
using osu.Game.Overlays.Direct;
namespace osu.Game.Overlays
@ -82,7 +83,7 @@ namespace osu.Game.Overlays
Padding = new MarginPadding { Top = Header.HEIGHT },
Children = new Drawable[]
{
new ContentFlow
new ReverseDepthFillFlowContainer<Drawable>
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
@ -136,16 +137,5 @@ namespace osu.Game.Overlays
filter.Search.HoldFocus = false;
}
private class ContentFlow : FillFlowContainer<Drawable>
{
protected override IComparer<Drawable> DepthComparer => new ReverseCreationOrderDepthComparer();
protected override IEnumerable<Drawable> FlowingChildren => base.FlowingChildren.Reverse();
public ContentFlow()
{
Direction = FillDirection.Vertical;
}
}
}
}