aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/conversation_titlebar
diff options
context:
space:
mode:
authorfiaxh <fiaxh@users.noreply.github.com>2018-08-31 16:25:51 +0200
committerGitHub <noreply@github.com>2018-08-31 16:25:51 +0200
commitecb18afdb51b3230ea451a27a5b345cf5100f02e (patch)
tree44bae666c4cc31afce3a5d6891f6b4f65dfcebb1 /main/src/ui/conversation_titlebar
parent9e93a77a624aed24402cf1ece69c05aaa0aab600 (diff)
parentf5547076d2397cec5c9d7374bd161f93327488c4 (diff)
downloaddino-ecb18afdb51b3230ea451a27a5b345cf5100f02e.tar.gz
dino-ecb18afdb51b3230ea451a27a5b345cf5100f02e.zip
Merge pull request #415 from bobufa/message-search
Message search
Diffstat (limited to 'main/src/ui/conversation_titlebar')
-rw-r--r--main/src/ui/conversation_titlebar/search_entry.vala30
-rw-r--r--main/src/ui/conversation_titlebar/view.vala3
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) {