aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/conversation_summary/status_item.vala
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2017-03-11 23:52:12 +0100
committerMarvin W <git@larma.de>2017-03-11 23:58:35 +0100
commite27d63269d0b41fa8d5b5f0f2e4a9dc7de4b9ab9 (patch)
tree80e547d0e02e770e8bcd912e42f8afa753aeb0f6 /main/src/ui/conversation_summary/status_item.vala
parentcd6b904e970291a63551d0f1d80bbd550e778ec8 (diff)
downloaddino-e27d63269d0b41fa8d5b5f0f2e4a9dc7de4b9ab9.tar.gz
dino-e27d63269d0b41fa8d5b5f0f2e4a9dc7de4b9ab9.zip
Move UI code into main dir
Diffstat (limited to 'main/src/ui/conversation_summary/status_item.vala')
-rw-r--r--main/src/ui/conversation_summary/status_item.vala30
1 files changed, 30 insertions, 0 deletions
diff --git a/main/src/ui/conversation_summary/status_item.vala b/main/src/ui/conversation_summary/status_item.vala
new file mode 100644
index 00000000..0775d8f3
--- /dev/null
+++ b/main/src/ui/conversation_summary/status_item.vala
@@ -0,0 +1,30 @@
+using Gtk;
+using Markup;
+
+using Dino.Entities;
+
+namespace Dino.Ui.ConversationSummary {
+
+private class StatusItem : Grid {
+
+ private Image image = new Image();
+ private Label label = new Label("");
+
+ private StreamInteractor stream_interactor;
+ private Conversation conversation;
+
+ public StatusItem(StreamInteractor stream_interactor, Conversation conversation, string? text) {
+ Object(column_spacing : 7);
+ set_hexpand(true);
+ this.stream_interactor = stream_interactor;
+ this.conversation = conversation;
+ image.set_from_pixbuf((new AvatarGenerator(30, 30)).set_greyscale(true).draw_conversation(stream_interactor, conversation));
+ attach(image, 0, 0, 1, 1);
+ attach(label, 1, 0, 1, 1);
+ string display_name = Util.get_display_name(stream_interactor, conversation.counterpart, conversation.account);
+ label.set_markup(@"<span foreground=\"#B1B1B1\"> $(escape_text(display_name)) $text </span>");
+ show_all();
+ }
+}
+
+} \ No newline at end of file