From a417cb396b18fe7ffc2a75fc640327d70793f85d Mon Sep 17 00:00:00 2001 From: fiaxh Date: Wed, 17 Feb 2021 14:50:23 -0600 Subject: Fix cyclic reference --- .../conversation_item_skeleton.vala | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 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 96a2368a..c0099bf4 100644 --- a/main/src/ui/conversation_content_view/conversation_item_skeleton.vala +++ b/main/src/ui/conversation_content_view/conversation_item_skeleton.vala @@ -32,13 +32,7 @@ public class ConversationItemSkeleton : EventBox { this.get_style_context().add_class("message-box"); item.bind_property("in-edit-mode", this, "item-in-edit-mode"); - this.notify["item-in-edit-mode"].connect(() => { - if (item.in_edit_mode) { - this.get_style_context().add_class("edit-mode"); - } else { - this.get_style_context().remove_class("edit-mode"); - } - }); + this.notify["item-in-edit-mode"].connect(update_edit_mode); widget = item.get_widget(Plugins.WidgetType.GTK) as Widget; if (widget != null) { @@ -94,6 +88,14 @@ public class ConversationItemSkeleton : EventBox { image_content_box.margin_bottom = 4; } } + + private void update_edit_mode() { + if (item.in_edit_mode) { + this.get_style_context().add_class("edit-mode"); + } else { + this.get_style_context().remove_class("edit-mode"); + } + } } [GtkTemplate (ui = "/im/dino/Dino/conversation_content_view/item_metadata_header.ui")] -- cgit v1.2.3-70-g09d2