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/menu_entry.vala | |
parent | f83e1188c5dcf1981832f296203f94503b467e30 (diff) | |
download | dino-ea174ab632ced082eb0f1c51cea1bc9dc5c7c89e.tar.gz dino-ea174ab632ced082eb0f1c51cea1bc9dc5c7c89e.zip |
Http file upload
Diffstat (limited to 'main/src/ui/conversation_titlebar/menu_entry.vala')
-rw-r--r-- | main/src/ui/conversation_titlebar/menu_entry.vala | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/main/src/ui/conversation_titlebar/menu_entry.vala b/main/src/ui/conversation_titlebar/menu_entry.vala new file mode 100644 index 00000000..6cead69d --- /dev/null +++ b/main/src/ui/conversation_titlebar/menu_entry.vala @@ -0,0 +1,47 @@ +using Gtk; + +using Dino.Entities; + +namespace Dino.Ui { + +class MenuEntry : Plugins.ConversationTitlebarEntry { + public override string id { get { return "menu"; } } + + StreamInteractor stream_interactor; + + public MenuEntry(StreamInteractor stream_interactor) { + this.stream_interactor = stream_interactor; + } + + public override double order { get { return 0; } } + public override Plugins.ConversationTitlebarWidget get_widget() { + return new MenuWidget(stream_interactor) { visible=true }; + } +} + +class MenuWidget : MenuButton, Plugins.ConversationTitlebarWidget { + + private Conversation? conversation; + + public MenuWidget(StreamInteractor stream_interactor) { + image = new Image.from_icon_name("open-menu-symbolic", IconSize.MENU); + + Builder builder = new Builder.from_resource("/org/dino-im/menu_conversation.ui"); + MenuModel menu = builder.get_object("menu_conversation") as MenuModel; + set_menu_model(menu); + + SimpleAction contact_details_action = new SimpleAction("contact_details", null); + contact_details_action.activate.connect(() => { + ContactDetails.Dialog contact_details_dialog = new ContactDetails.Dialog(stream_interactor, conversation); + contact_details_dialog.set_transient_for((Window) get_toplevel()); + contact_details_dialog.present(); + }); + GLib.Application.get_default().add_action(contact_details_action); + } + + public new void set_conversation(Conversation conversation) { + this.conversation = conversation; + } +} + +} |