[gitg] Port to GtkSearchBar
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gitg] Port to GtkSearchBar
- Date: Sat, 22 Jun 2013 10:21:30 +0000 (UTC)
commit 66556e061ba3b7fb1b95310b5b2871fd39c07cbc
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Sat Jun 22 12:20:50 2013 +0200
Port to GtkSearchBar
gitg/gitg-window.vala | 6 +++-
gitg/resources/ui/gitg-window.ui | 43 +++++++------------------------------
2 files changed, 12 insertions(+), 37 deletions(-)
---
diff --git a/gitg/gitg-window.vala b/gitg/gitg-window.vala
index 373ce18..c89a82c 100644
--- a/gitg/gitg-window.vala
+++ b/gitg/gitg-window.vala
@@ -49,7 +49,7 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
private Gtk.StackSwitcher d_commit_view_switcher;
[GtkChild]
- private Gtk.Revealer d_search_revealer;
+ private Gtk.SearchBar d_search_bar;
[GtkChild]
private Gd.TaggedEntry d_search_entry;
@@ -149,7 +149,9 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
d_dash_model = Resource.load_object<MenuModel>("ui/gitg-menus.ui", menuname + "-dash");
d_views_model = Resource.load_object<MenuModel>("ui/gitg-menus.ui", menuname + "-views");
- d_search_button.bind_property("active", d_search_revealer, "reveal-child");
+ // search bar
+ d_search_bar.connect_entry(d_search_entry);
+ d_search_button.bind_property("active", d_search_bar, "search-mode-enabled");
}
private void on_close_activated()
diff --git a/gitg/resources/ui/gitg-window.ui b/gitg/resources/ui/gitg-window.ui
index 89d84b5..b6b2c3a 100644
--- a/gitg/resources/ui/gitg-window.ui
+++ b/gitg/resources/ui/gitg-window.ui
@@ -123,45 +123,18 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
- <object class="GtkRevealer" id="d_search_revealer">
+ <object class="GtkSearchBar" id="d_search_bar">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="reveal-child">False</property>
+ <property name="show-close-button">False</property>
<child>
- <object class="GtkToolbar" id="toolbar_search">
+ <object class="GdTaggedEntry" id="d_search_entry">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <style>
- <class name="primary-toolbar"/>
- </style>
- <child>
- <object class="GtkToolItem" id="toolbutton3">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <object class="GtkBox" id="box_search_entry">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="can_focus">False</property>
- <property name="halign">center</property>
- <child>
- <object class="GdTaggedEntry" id="d_search_entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">●</property>
- <property name="invisible_char_set">True</property>
- <property name="width-request">500</property>
- <signal name="changed" handler="search_entry_changed" swapped="no"/>
- </object>
- </child>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="homogeneous">True</property>
- </packing>
- </child>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <property name="invisible_char_set">True</property>
+ <property name="width-request">500</property>
+ <signal name="changed" handler="search_entry_changed" swapped="no"/>
</object>
</child>
</object>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]