[gitg] Make the search entry an extra toolbar using a revealer



commit b84ff175cadaae20dc474194ca0f7c1932a1b133
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Sat Feb 16 17:30:44 2013 +0100

    Make the search entry an extra toolbar using a revealer

 gitg/Makefile.am                 |    5 ++
 gitg/gitg-window.vala            |    4 ++
 gitg/resources/ui/gitg-window.ui |   81 +++++++++++++++++++++++++++++++++----
 3 files changed, 81 insertions(+), 9 deletions(-)
---
diff --git a/gitg/Makefile.am b/gitg/Makefile.am
index 35e6068..f9778e7 100644
--- a/gitg/Makefile.am
+++ b/gitg/Makefile.am
@@ -3,6 +3,7 @@ bin_PROGRAMS = gitg
 AM_CPPFLAGS =                                                  \
        -I$(top_srcdir)                                         \
        -I$(srcdir)                                             \
+       -I$(top_srcdir)/libgd                                   \
        $(GITG_CFLAGS)                                          \
        $(WARN_CFLAGS)                                          \
        -DDATADIR=\""$(datadir)"\"                              \
@@ -21,8 +22,11 @@ AM_VALAFLAGS = \
        --pkg libpeas-1.0                                       \
        --pkg gobject-introspection-1.0                         \
        --pkg gee-1.0                                           \
+       --pkg gd-1.0                                            \
+       --girdir "$(top_builddir)/libgd"                        \
        --girdir "$(top_builddir)/libgitg"                      \
        --girdir "$(top_builddir)/libgitg-ext"                  \
+       --vapidir "$(top_builddir)/libgd"                       \
        --vapidir "$(top_builddir)/libgitg"                     \
        --vapidir "$(top_builddir)/libgitg-ext"
 
@@ -50,6 +54,7 @@ gitg_SOURCES =                                                        \
 gitg_LDADD =                                                   \
        $(GITG_LIBS)                                            \
        $(PACKAGE_LIBS)                                         \
+       $(top_builddir)/libgd/libgd.la                          \
        $(top_builddir)/libgitg/libgitg-1.0.la                  \
        $(top_builddir)/libgitg-ext/libgitg-ext-1.0.la
 
diff --git a/gitg/gitg-window.vala b/gitg/gitg-window.vala
index 9a076e9..e9cf6e3 100644
--- a/gitg/gitg-window.vala
+++ b/gitg/gitg-window.vala
@@ -76,6 +76,10 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable, Gtk.
                var model = Resource.load_object<MenuModel>("ui/gitg-menus.ui", "win-menu");
                d_config.menu_model = model;
 
+               var search_button = builder.get_object("search-button");
+               var revealer = builder.get_object("search-revealer") as Gd.Revealer;
+               search_button.bind_property("active", revealer, "reveal-child");
+
                var settings = new Settings("org.gnome.gitg.preferences.interface");
 
                settings.bind("orientation",
diff --git a/gitg/resources/ui/gitg-window.ui b/gitg/resources/ui/gitg-window.ui
index 0651c34..b471d4f 100644
--- a/gitg/resources/ui/gitg-window.ui
+++ b/gitg/resources/ui/gitg-window.ui
@@ -2,6 +2,7 @@
 <interface>
   <!-- interface-requires gtk+ 3.3 -->
   <!-- interface-requires gitg 0.0 -->
+  <!-- interface-requires gd 1.0 -->
   <object class="GtkImage" id="image_config">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
@@ -32,22 +33,24 @@
               <object class="GtkToolItem" id="toolbutton1">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <style>
-                  <class name="raised"/>
-                </style>
                 <child>
-                  <object class="GtkAlignment" id="entry-alignment">
+                  <object class="GtkAlignment" id="search-button-alignment">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="xalign">1</property>
                     <property name="xscale">0</property>
                     <child>
-                      <object class="GtkSearchEntry" id="search-entry">
-                        <property name="width_request">210</property>
+                      <object class="GtkToggleButton" id="search-button">
                         <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="receives_default">True</property>
+                        <child>
+                          <object class="GtkImage" id="image1">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="icon_name">edit-find-symbolic</property>
+                          </object>
+                        </child>
                       </object>
                     </child>
                   </object>
@@ -86,6 +89,66 @@
           </packing>
         </child>
         <child>
+          <object class="GdRevealer" id="search-revealer">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="orientation">horizontal</property>
+            <property name="reveal-child">False</property>
+            <child>
+              <object class="GtkToolbar" id="toolbar-search">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <style>
+                  <class name="inline-toolbar"/>
+                </style>
+                <child>
+                  <object class="GtkToolItem" id="toolbutton3">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <child>
+                      <object class="GtkAlignment" id="alignment-search-entry">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="xalign">0.5</property>
+                        <property name="left-padding">200</property>
+                        <property name="right-padding">200</property>
+                        <property name="top-padding">2</property>
+                        <property name="bottom-padding">2</property>
+                        <child>
+                          <object class="GtkGrid" id="grid-search-entry">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="can_focus">False</property>
+                            <child>
+                              <object class="GtkSearchEntry" id="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="hexpand">True</property>
+                              </object>
+                            </child>
+                          </object>
+                        </child>
+                      </object>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">True</property>
+                    <property name="homogeneous">True</property>
+                  </packing>
+                </child>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="left_attach">0</property>
+            <property name="top_attach">1</property>
+            <property name="width">1</property>
+            <property name="height">1</property>
+          </packing>
+        </child>
+        <child>
           <object class="GtkPaned" id="paned_views">
             <property name="visible">True</property>
             <property name="can_focus">True</property>
@@ -228,7 +291,7 @@
           </object>
           <packing>
             <property name="left_attach">0</property>
-            <property name="top_attach">1</property>
+            <property name="top_attach">2</property>
             <property name="width">1</property>
             <property name="height">1</property>
           </packing>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]