diff options
author | fiaxh <git@lightrise.org> | 2021-02-10 18:32:39 -0600 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2021-02-10 18:32:39 -0600 |
commit | 0626bad8e9c2f7dfd4d8eccc86ec1e8bec6c7308 (patch) | |
tree | 8d0d550dc8b07ae05c30dce279243b00dd77b4b6 /main/src/ui/conversation_content_view | |
parent | ad031ee33366aefc003ed3cac3a74079d963bfe9 (diff) | |
download | dino-0626bad8e9c2f7dfd4d8eccc86ec1e8bec6c7308.tar.gz dino-0626bad8e9c2f7dfd4d8eccc86ec1e8bec6c7308.zip |
Reduce use of Widget.destroy()
On non-toplevel windows, use Container.remove() instead of Widget.destroy()
Needed for migration to GTK4
https://developer.gnome.org/gtk4/unstable/gtk-migrating-3-to-4.html#id-1.7.4.3.17
Diffstat (limited to 'main/src/ui/conversation_content_view')
-rw-r--r-- | main/src/ui/conversation_content_view/conversation_item_skeleton.vala | 2 | ||||
-rw-r--r-- | main/src/ui/conversation_content_view/conversation_view.vala | 9 |
2 files changed, 5 insertions, 6 deletions
diff --git a/main/src/ui/conversation_content_view/conversation_item_skeleton.vala b/main/src/ui/conversation_content_view/conversation_item_skeleton.vala index c3db09e0..96a2368a 100644 --- a/main/src/ui/conversation_content_view/conversation_item_skeleton.vala +++ b/main/src/ui/conversation_content_view/conversation_item_skeleton.vala @@ -164,7 +164,7 @@ public class ItemMetaDataHeader : Box { this.reorder_child(unencrypted_image, 3); Util.force_error_color(unencrypted_image); } else if (conversation.encryption == Encryption.NONE && unencrypted_image != null) { - unencrypted_image.destroy(); + this.remove(unencrypted_image); unencrypted_image = null; } } diff --git a/main/src/ui/conversation_content_view/conversation_view.vala b/main/src/ui/conversation_content_view/conversation_view.vala index 70b16bd9..9eb18cfd 100644 --- a/main/src/ui/conversation_content_view/conversation_view.vala +++ b/main/src/ui/conversation_content_view/conversation_view.vala @@ -318,9 +318,8 @@ public class ConversationView : Box, Plugins.ConversationItemCollection, Plugins private void remove_item(Plugins.MetaConversationItem item) { ConversationItemSkeleton? skeleton = item_item_skeletons[item]; if (skeleton != null) { - widgets[item].destroy(); + main.remove(skeleton); widgets.unset(item); - skeleton.destroy(); item_skeletons.remove(skeleton); item_item_skeletons.unset(item); @@ -356,7 +355,7 @@ public class ConversationView : Box, Plugins.ConversationItemCollection, Plugins public void remove_notification(Widget widget) { notification_revealer.reveal_child = false; - widget.destroy(); + notifications.remove(widget); } private Widget insert_new(Plugins.MetaConversationItem item) { @@ -484,11 +483,11 @@ public class ConversationView : Box, Plugins.ConversationItemCollection, Plugins item_skeletons.clear(); item_item_skeletons.clear(); widgets.clear(); - main.@foreach((widget) => { widget.destroy(); }); + main.@foreach((widget) => { main.remove(widget); }); } private void clear_notifications() { - notifications.@foreach((widget) => { widget.destroy(); }); + notifications.@foreach((widget) => { notifications.remove(widget); }); notification_revealer.transition_duration = 0; notification_revealer.set_reveal_child(false); } |