[gnome-builder] egg-search-bar: use GtkSearchEntry



commit 074d4bfff459a21d8d06dba30ea33b2042913a6c
Author: Christian Hergert <christian hergert me>
Date:   Mon May 4 12:00:47 2015 -0700

    egg-search-bar: use GtkSearchEntry
    
    Since it is rather easy to override the primary-icon-name, let's just
    use GtkSearchEntry here.

 contrib/egg/egg-search-bar.c     |   12 ++++++------
 data/ui/gb-preferences-window.ui |    1 +
 2 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/contrib/egg/egg-search-bar.c b/contrib/egg/egg-search-bar.c
index 1b5459a..4c7b923 100644
--- a/contrib/egg/egg-search-bar.c
+++ b/contrib/egg/egg-search-bar.c
@@ -26,7 +26,7 @@ typedef struct
 {
   GtkRevealer    *revealer;
   GtkBox         *box;
-  GtkEntry       *entry;
+  GtkSearchEntry *entry;
   GtkButton      *close_button;
 
   gulong          key_press_event_handler;
@@ -57,11 +57,11 @@ static GParamSpec *gParamSpecs [LAST_PROP];
 static guint       gSignals [LAST_SIGNAL];
 
 static void
-egg_search_bar__entry_activate (EggSearchBar *self,
-                                GtkEntry     *entry)
+egg_search_bar__entry_activate (EggSearchBar   *self,
+                                GtkSearchEntry *entry)
 {
   g_assert (EGG_IS_SEARCH_BAR (self));
-  g_assert (GTK_IS_ENTRY (entry));
+  g_assert (GTK_IS_SEARCH_ENTRY (entry));
 
   g_signal_emit (self, gSignals [ACTIVATE], 0);
 }
@@ -322,7 +322,7 @@ egg_search_bar_init (EggSearchBar *self)
                   "visible", TRUE,
                   NULL);
   priv->entry =
-    g_object_connect (g_object_new (GTK_TYPE_ENTRY,
+    g_object_connect (g_object_new (GTK_TYPE_SEARCH_ENTRY,
                                     "placeholder-text", _("Search"),
                                     "visible", TRUE,
                                     NULL),
@@ -388,7 +388,7 @@ egg_search_bar_set_search_mode_enabled (EggSearchBar *self,
     {
       priv->search_mode_enabled = search_mode_enabled;
       gtk_revealer_set_reveal_child (priv->revealer, search_mode_enabled);
-      gtk_entry_set_text (priv->entry, "");
+      gtk_entry_set_text (GTK_ENTRY (priv->entry), "");
       g_object_notify_by_pspec (G_OBJECT (self), gParamSpecs [PROP_SEARCH_MODE_ENABLED]);
     }
 }
diff --git a/data/ui/gb-preferences-window.ui b/data/ui/gb-preferences-window.ui
index 3e63d66..36de408 100644
--- a/data/ui/gb-preferences-window.ui
+++ b/data/ui/gb-preferences-window.ui
@@ -73,6 +73,7 @@
                 <property name="search-mode-enabled" bind-source="search_toggle" bind-property="active" 
bind-flags="bidirectional">False</property>
                 <child internal-child="entry">
                   <object class="GtkEntry" id="search_entry">
+                    <property name="primary-icon-name"></property>
                     <property name="placeholder-text" translatable="yes">Search Preferences…</property>
                     <property name="visible">True</property>
                   </object>


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