diff options
-rw-r--r-- | core/src/widget/box.vala | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/src/widget/box.vala b/core/src/widget/box.vala index 39dee92..6bd1bcb 100644 --- a/core/src/widget/box.vala +++ b/core/src/widget/box.vala @@ -9,7 +9,7 @@ public class Box : Gtk.Box { /** * wether to implicity destroy previous children when setting them */ - public bool implicit_destroy { get; set; default = true; } + public bool no_implicit_destroy { get; set; default = false; } public List<weak Gtk.Widget> children { set { _set_children(value); } @@ -42,10 +42,10 @@ public class Box : Gtk.Box { private void _set_children(List<weak Gtk.Widget> arr) { foreach(var child in get_children()) { - if (implicit_destroy && arr.find(child).length() == 0) - child.destroy(); - else + if (no_implicit_destroy) remove(child); + else if (arr.find(child).length() == 0) + child.destroy(); } foreach(var child in arr) |