summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAylur <[email protected]>2024-06-23 11:37:27 +0200
committerAylur <[email protected]>2024-06-23 11:37:27 +0200
commit757dbd9b6569997f9a8a8ce69629f69b0df1c8fd (patch)
tree6a2a1eb557d6538fe7425466f3cf50f0710931ba /src
parentb97552032f0cf9e4d79bfaa7fe8bd090c1fe2fdb (diff)
fix(box): only destroy old children
Diffstat (limited to 'src')
-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);