diff options
author | fiaxh <git@mx.ax.lt> | 2017-08-02 17:29:55 +0200 |
---|---|---|
committer | fiaxh <git@mx.ax.lt> | 2017-08-03 15:59:04 +0200 |
commit | ea174ab632ced082eb0f1c51cea1bc9dc5c7c89e (patch) | |
tree | 8f83d1379a48e7aa49af5a5146d76a4c595f2363 /main/src/ui/conversation_titlebar/occupants_entry.vala | |
parent | f83e1188c5dcf1981832f296203f94503b467e30 (diff) | |
download | dino-ea174ab632ced082eb0f1c51cea1bc9dc5c7c89e.tar.gz dino-ea174ab632ced082eb0f1c51cea1bc9dc5c7c89e.zip |
Http file upload
Diffstat (limited to 'main/src/ui/conversation_titlebar/occupants_entry.vala')
-rw-r--r-- | main/src/ui/conversation_titlebar/occupants_entry.vala | 50 |
1 files changed, 50 insertions, 0 deletions
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); + } + } +} + +} |