diff options
author | fiaxh <git@lightrise.org> | 2021-08-14 20:22:52 +0200 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2021-08-17 22:32:33 +0200 |
commit | 447464f4d1ac0c184764f103ac9e51f7ff2dce91 (patch) | |
tree | df4aab32001564c5aa706500ce6e7d68904e2d47 /main/src/ui/conversation_content_view/conversation_item_skeleton.vala | |
parent | cf8501ba30e26bbc02b42204acf5cff650b338f4 (diff) | |
download | dino-447464f4d1ac0c184764f103ac9e51f7ff2dce91.tar.gz dino-447464f4d1ac0c184764f103ac9e51f7ff2dce91.zip |
Display message delivery error, color text using theme colors
fixes #672
Diffstat (limited to 'main/src/ui/conversation_content_view/conversation_item_skeleton.vala')
-rw-r--r-- | main/src/ui/conversation_content_view/conversation_item_skeleton.vala | 13 |
1 files changed, 13 insertions, 0 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 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")] |