From c704aa61606e20121df9ae940509830b8235a61d Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Thu, 19 Dec 2019 12:52:31 +0100 Subject: [PATCH] allow children to be reversed --- MLEM.Ui/Elements/Element.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/MLEM.Ui/Elements/Element.cs b/MLEM.Ui/Elements/Element.cs index a514592..1de91d7 100644 --- a/MLEM.Ui/Elements/Element.cs +++ b/MLEM.Ui/Elements/Element.cs @@ -492,6 +492,10 @@ namespace MLEM.Ui.Elements { this.Children.Sort(comparison); } + public void ReverseChildren(int index = 0, int? count = null) { + this.Children.Reverse(index, count ?? this.Children.Count); + } + protected virtual void InitStyle(UiStyle style) { this.SelectionIndicator.SetFromStyle(style.SelectionIndicator); }