From 1e62513e2507664741a31a361e5c46d3d62ed41e Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Thu, 12 Dec 2019 21:14:41 +0100 Subject: [PATCH] added a way to sort an element's children --- 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 c2be578..534f9bc 100644 --- a/MLEM.Ui/Elements/Element.cs +++ b/MLEM.Ui/Elements/Element.cs @@ -484,6 +484,10 @@ namespace MLEM.Ui.Elements { child.AndChildren(action); } + public void ReorderChildren(Comparison comparison) { + this.Children.Sort(comparison); + } + protected virtual void InitStyle(UiStyle style) { this.SelectionIndicator.SetFromStyle(style.SelectionIndicator); }