From 447464f4d1ac0c184764f103ac9e51f7ff2dce91 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Sat, 14 Aug 2021 20:22:52 +0200 Subject: Display message delivery error, color text using theme colors fixes #672 --- .../conversation_item_skeleton.vala | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'main/src/ui/conversation_content_view/conversation_item_skeleton.vala') 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 bcb6864e..343c6631 100644 --- a/main/src/ui/conversation_content_view/conversation_item_skeleton.vala +++ b/main/src/ui/conversation_content_view/conversation_item_skeleton.vala @@ -16,6 +16,7 @@ public class ConversationItemSkeleton : EventBox { public Conversation conversation { get; set; } public Plugins.MetaConversationItem item; public bool item_in_edit_mode { get; set; } + public Entities.Message.Marked item_mark { get; set; } public ContentMetaItem? content_meta_item = null; public Widget? widget = null; @@ -34,6 +35,10 @@ public class ConversationItemSkeleton : EventBox { item.bind_property("in-edit-mode", this, "item-in-edit-mode"); this.notify["item-in-edit-mode"].connect(update_edit_mode); + item.bind_property("mark", this, "item-mark", BindingFlags.SYNC_CREATE); + this.notify["item-mark"].connect(update_error_mode); + update_error_mode(); + widget = item.get_widget(Plugins.WidgetType.GTK) as Widget; if (widget != null) { widget.valign = Align.END; @@ -96,6 +101,14 @@ public class ConversationItemSkeleton : EventBox { this.get_style_context().remove_class("edit-mode"); } } + + private void update_error_mode() { + if (item_mark == Message.Marked.ERROR) { + this.get_style_context().add_class("error"); + } else { + this.get_style_context().remove_class("error"); + } + } } [GtkTemplate (ui = "/im/dino/Dino/conversation_content_view/item_metadata_header.ui")] -- cgit v1.3