From e27d63269d0b41fa8d5b5f0f2e4a9dc7de4b9ab9 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sat, 11 Mar 2017 23:52:12 +0100 Subject: Move UI code into main dir --- .../conversation_summary/merged_status_item.vala | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 main/src/ui/conversation_summary/merged_status_item.vala (limited to 'main/src/ui/conversation_summary/merged_status_item.vala') diff --git a/main/src/ui/conversation_summary/merged_status_item.vala b/main/src/ui/conversation_summary/merged_status_item.vala new file mode 100644 index 00000000..1fe8ecf3 --- /dev/null +++ b/main/src/ui/conversation_summary/merged_status_item.vala @@ -0,0 +1,31 @@ +using Gee; +using Gtk; + +using Dino.Entities; + +namespace Dino.Ui.ConversationSummary { + +private class MergedStatusItem : Expander { + + private StreamInteractor stream_interactor; + private Conversation conversation; + private ArrayList statuses = new ArrayList(); + + public MergedStatusItem(StreamInteractor stream_interactor, Conversation conversation, Show show) { + set_hexpand(true); + add_status(show); + } + + public void add_status(Show show) { + statuses.add(show); + StatusItem status_item = new StatusItem(stream_interactor, conversation, @"is $(show.as)"); + if (statuses.size == 1) { + label = show.as; + } else { + label = @"changed their status $(statuses.size) times"; + add(new Label(show.as)); + } + } +} + +} \ No newline at end of file -- cgit v1.2.3-70-g09d2