From 757dbd9b6569997f9a8a8ce69629f69b0df1c8fd Mon Sep 17 00:00:00 2001 From: Aylur Date: Sun, 23 Jun 2024 11:37:27 +0200 Subject: fix(box): only destroy old children --- src/widget/box.vala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/widget/box.vala b/src/widget/box.vala index d1c4a6b..b4f0e82 100644 --- a/src/widget/box.vala +++ b/src/widget/box.vala @@ -8,6 +8,7 @@ public class Box : Gtk.Box { /** * wether to implicity destroy previous children when setting them + * TODO: should it be opt out? */ public bool implicit_destroy { get; set; default = false; } @@ -42,7 +43,7 @@ public class Box : Gtk.Box { private void _set_children(List arr) { foreach(var child in get_children()) { - if (implicit_destroy) + if (implicit_destroy && arr.find(child).length() == 0) child.destroy(); else remove(child); -- cgit v1.2.3