aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/conversation_titlebar
diff options
context:
space:
mode:
authorbobufa <bobufa@users.noreply.github.com>2018-07-04 23:38:28 +0200
committerbobufa <bobufa@users.noreply.github.com>2018-08-13 22:28:45 +0200
commit8b23ddad2d33a1504cd28c0df583dfe50cadccda (patch)
treec34829ba57aae1ea9d7291d1e4a91e2cfbd337c1 /main/src/ui/conversation_titlebar
parentbabfc3bd36e0cfa50f06648224f33a6a96eb27ea (diff)
downloaddino-8b23ddad2d33a1504cd28c0df583dfe50cadccda.tar.gz
dino-8b23ddad2d33a1504cd28c0df583dfe50cadccda.zip
ui: search sidebar initial
Diffstat (limited to 'main/src/ui/conversation_titlebar')
-rw-r--r--main/src/ui/conversation_titlebar/search_entry.vala32
-rw-r--r--main/src/ui/conversation_titlebar/view.vala3
2 files changed, 35 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..e80e5954
--- /dev/null
+++ b/main/src/ui/conversation_titlebar/search_entry.vala
@@ -0,0 +1,32 @@
+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) {
+ active = false;
+ }
+}
+
+}
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) {