From 56bc45ce4d07a7a9a415e9dc8ad2f7c3f3c9e48d Mon Sep 17 00:00:00 2001 From: fiaxh Date: Thu, 2 Mar 2017 15:37:32 +0100 Subject: Initial commit --- .../src/ui/conversation_summary/status_item.vala | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 client/src/ui/conversation_summary/status_item.vala (limited to 'client/src/ui/conversation_summary/status_item.vala') diff --git a/client/src/ui/conversation_summary/status_item.vala b/client/src/ui/conversation_summary/status_item.vala new file mode 100644 index 00000000..5918d008 --- /dev/null +++ b/client/src/ui/conversation_summary/status_item.vala @@ -0,0 +1,29 @@ +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(@" $(escape_text(display_name)) $text "); + show_all(); + } +} +} \ No newline at end of file -- cgit v1.2.3