aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/conversation_summary
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2018-12-27 12:35:48 +0100
committerfiaxh <git@lightrise.org>2018-12-27 13:01:35 +0100
commit965f4da75ae5a5b308191bd61890b4277504f5b1 (patch)
tree038763267d512b8f64681af80fdeec4e09de6f17 /main/src/ui/conversation_summary
parentd0d68f5878267320eb99ad544e9117553af11532 (diff)
downloaddino-965f4da75ae5a5b308191bd61890b4277504f5b1.tar.gz
dino-965f4da75ae5a5b308191bd61890b4277504f5b1.zip
Detect emoji-only messages and display them larger
Diffstat (limited to 'main/src/ui/conversation_summary')
-rw-r--r--main/src/ui/conversation_summary/content_item_widget_factory.vala7
1 files changed, 7 insertions, 0 deletions
diff --git a/main/src/ui/conversation_summary/content_item_widget_factory.vala b/main/src/ui/conversation_summary/content_item_widget_factory.vala
index d8f65b3c..d8d21ebd 100644
--- a/main/src/ui/conversation_summary/content_item_widget_factory.vala
+++ b/main/src/ui/conversation_summary/content_item_widget_factory.vala
@@ -3,6 +3,7 @@ using Gdk;
using Gtk;
using Pango;
using Xmpp;
+using Unicode;
using Dino.Entities;
@@ -75,6 +76,12 @@ public class MessageItemWidgetGenerator : WidgetGenerator, Object {
label.style_updated.connect(() => update_me_style(stream_interactor, message.real_jid ?? message.from, display_name, conversation.account, label, markup_text));
}
+ int only_emoji_count = Util.get_only_emoji_count(markup_text);
+ if (only_emoji_count != -1) {
+ string size_str = only_emoji_count < 5 ? "xx-large" : "large";
+ markup_text = @"<span size=\'$size_str\'>" + markup_text + "</span>";
+ }
+
label.label = markup_text;
return label;
}