Fix cyclic reference

This commit is contained in:
fiaxh 2021-02-17 14:50:23 -06:00
parent 80c8e18cea
commit a417cb396b

View file

@ -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")]