summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/widget/box.vala3
1 files changed, 2 insertions, 1 deletions
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<weak Gtk.Widget> arr) {
foreach(var child in get_children()) {
- if (implicit_destroy)
+ if (implicit_destroy && arr.find(child).length() == 0)
child.destroy();
else
remove(child);