diff options
Diffstat (limited to 'main/src/ui/conversation_titlebar')
-rw-r--r-- | main/src/ui/conversation_titlebar/search_entry.vala | 30 | ||||
-rw-r--r-- | main/src/ui/conversation_titlebar/view.vala | 3 |
2 files changed, 33 insertions, 0 deletions
diff --git a/main/src/ui/conversation_titlebar/search_entry.vala b/main/src/ui/conversation_titlebar/search_entry.vala new file mode 100644 index 00000000..b452bdce --- /dev/null +++ b/main/src/ui/conversation_titlebar/search_entry.vala @@ -0,0 +1,30 @@ +using Gtk; +using Gee; + +using Dino.Entities; + +namespace Dino.Ui { + +public class SearchMenuEntry : Plugins.ConversationTitlebarEntry, Object { + public string id { get { return "search"; } } + + Plugins.ConversationTitlebarWidget search_button; + + public SearchMenuEntry(Plugins.ConversationTitlebarWidget search_button) { + this.search_button = search_button; + } + + public double order { get { return 1; } } + public Plugins.ConversationTitlebarWidget? get_widget(Plugins.WidgetType type) { + if (type == Plugins.WidgetType.GTK) { + return search_button; + } + return null; + } +} + +public class GlobalSearchButton : Plugins.ConversationTitlebarWidget, Gtk.ToggleButton { + public new void set_conversation(Conversation conversation) { } +} + +} diff --git a/main/src/ui/conversation_titlebar/view.vala b/main/src/ui/conversation_titlebar/view.vala index d01cd9bb..13a9bf80 100644 --- a/main/src/ui/conversation_titlebar/view.vala +++ b/main/src/ui/conversation_titlebar/view.vala @@ -11,6 +11,7 @@ public class ConversationTitlebar : Gtk.HeaderBar { private Window window; private Conversation? conversation; private Gee.List<Plugins.ConversationTitlebarWidget> widgets = new ArrayList<Plugins.ConversationTitlebarWidget>(); + public GlobalSearchButton search_button = new GlobalSearchButton() { visible = true }; public ConversationTitlebar(StreamInteractor stream_interactor, Window window) { this.stream_interactor = stream_interactor; @@ -19,9 +20,11 @@ public class ConversationTitlebar : Gtk.HeaderBar { this.get_style_context().add_class("dino-right"); show_close_button = true; hexpand = true; + search_button.set_image(new Gtk.Image.from_icon_name("system-search-symbolic", Gtk.IconSize.MENU) { visible = true }); Application app = GLib.Application.get_default() as Application; app.plugin_registry.register_contact_titlebar_entry(new MenuEntry(stream_interactor)); + app.plugin_registry.register_contact_titlebar_entry(new SearchMenuEntry(search_button)); app.plugin_registry.register_contact_titlebar_entry(new OccupantsEntry(stream_interactor, window)); foreach(var e in app.plugin_registry.conversation_titlebar_entries) { |