From ea174ab632ced082eb0f1c51cea1bc9dc5c7c89e Mon Sep 17 00:00:00 2001 From: fiaxh Date: Wed, 2 Aug 2017 17:29:55 +0200 Subject: Http file upload --- .../ui/conversation_titlebar/occupants_entry.vala | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 main/src/ui/conversation_titlebar/occupants_entry.vala (limited to 'main/src/ui/conversation_titlebar/occupants_entry.vala') diff --git a/main/src/ui/conversation_titlebar/occupants_entry.vala b/main/src/ui/conversation_titlebar/occupants_entry.vala new file mode 100644 index 00000000..c305bed7 --- /dev/null +++ b/main/src/ui/conversation_titlebar/occupants_entry.vala @@ -0,0 +1,50 @@ +using Gtk; + +using Dino.Entities; + +namespace Dino.Ui { + +class OccupantsEntry : Plugins.ConversationTitlebarEntry { + public override string id { get { return "occupants"; } } + + StreamInteractor stream_interactor; + Window window; + + public OccupantsEntry(StreamInteractor stream_interactor, Window window) { + this.stream_interactor = stream_interactor; + this.window = window; + } + + public override double order { get { return 3; } } + public override Plugins.ConversationTitlebarWidget get_widget() { + return new OccupantsWidget(stream_interactor, window) { visible=true }; + } +} + +class OccupantsWidget : MenuButton, Plugins.ConversationTitlebarWidget { + + private Conversation? conversation; + private StreamInteractor stream_interactor; + private Window window; + + public OccupantsWidget(StreamInteractor stream_interactor, Window window) { + + image = new Image.from_icon_name("system-users-symbolic", IconSize.MENU); + + this.stream_interactor = stream_interactor; + this.window = window; + set_use_popover(true); + } + + public new void set_conversation(Conversation conversation) { + this.conversation = conversation; + + visible = conversation.type_ == Conversation.Type.GROUPCHAT; + if (conversation.type_ == Conversation.Type.GROUPCHAT) { + OccupantMenu.View menu = new OccupantMenu.View(stream_interactor, window, conversation); + set_popover(menu); + } + } +} + +} -- cgit v1.2.3-54-g00ecf