[gnome-documents] Use GtkSearchEntry



commit 9ab1dd41e39597f140dfe5b329be902f37e11ca3
Author: Bastien Nocera <hadess hadess net>
Date:   Mon Jun 11 19:20:58 2012 +0100

    Use GtkSearchEntry
    
    https://bugzilla.gnome.org/show_bug.cgi?id=677887

 configure.ac              |    2 +-
 src/lib/gd-tagged-entry.c |    2 +-
 src/lib/gd-tagged-entry.h |    4 ++--
 src/searchbar.js          |   18 ------------------
 4 files changed, 4 insertions(+), 22 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 6554dd1..353a1e3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -51,7 +51,7 @@ AC_SUBST(LIBM)
 
 EVINCE_MIN_VERSION=3.3.0
 GLIB_MIN_VERSION=2.31.6
-GTK_MIN_VERSION=3.3.6
+GTK_MIN_VERSION=3.5.5
 GOBJECT_INTROSPECTION_MIN_VERSION=1.31.6
 GDATA_MIN_VERSION=0.11.0
 GOA_MIN_VERSION=3.2.0
diff --git a/src/lib/gd-tagged-entry.c b/src/lib/gd-tagged-entry.c
index 8495b9f..73001ab 100644
--- a/src/lib/gd-tagged-entry.c
+++ b/src/lib/gd-tagged-entry.c
@@ -23,7 +23,7 @@
 
 #include <math.h>
 
-G_DEFINE_TYPE (GdTaggedEntry, gd_tagged_entry, GTK_TYPE_ENTRY)
+G_DEFINE_TYPE (GdTaggedEntry, gd_tagged_entry, GTK_TYPE_SEARCH_ENTRY)
 
 #define BUTTON_INTERNAL_SPACING 6
 
diff --git a/src/lib/gd-tagged-entry.h b/src/lib/gd-tagged-entry.h
index 9d4f10b..9a4a552 100644
--- a/src/lib/gd-tagged-entry.h
+++ b/src/lib/gd-tagged-entry.h
@@ -56,14 +56,14 @@ typedef struct _GdTaggedEntryPrivate GdTaggedEntryPrivate;
 
 struct _GdTaggedEntry
 {
-  GtkEntry parent;
+  GtkSearchEntry parent;
 
   GdTaggedEntryPrivate *priv;
 };
 
 struct _GdTaggedEntryClass
 {
-  GtkEntryClass parent_class;
+  GtkSearchEntryClass parent_class;
 };
 
 GType gd_tagged_entry_get_type (void) G_GNUC_CONST;
diff --git a/src/searchbar.js b/src/searchbar.js
index 0037c99..19e05cc 100644
--- a/src/searchbar.js
+++ b/src/searchbar.js
@@ -371,9 +371,6 @@ const Searchbar = new Lang.Class({
                                             height: 0 });
 
         this._searchEntry = new Gd.TaggedEntry({ width_request: 260,
-                                                 secondary_icon_name: 'edit-find-symbolic',
-                                                 secondary_icon_sensitive: false,
-                                                 secondary_icon_activatable: false,
                                                  no_show_all: true,
                                                  hexpand: true });
         this._searchEntry.connect('tag-clicked',
@@ -429,17 +426,6 @@ const Searchbar = new Lang.Class({
             }));
 
         this._searchEntry.connect('changed', Lang.bind(this, function() {
-            let text = this._searchEntry.get_text();
-            if (text && text != '') {
-                this._searchEntry.secondary_icon_name = 'edit-clear-symbolic';
-                this._searchEntry.secondary_icon_sensitive = true;
-                this._searchEntry.secondary_icon_activatable = true;
-            } else {
-                this._searchEntry.secondary_icon_name = 'edit-find-symbolic';
-                this._searchEntry.secondary_icon_sensitive = false;
-                this._searchEntry.secondary_icon_activatable = false;
-            }
-
             if (this._searchEntryTimeout != 0) {
                 Mainloop.source_remove(this._searchEntryTimeout);
                 this._searchEntryTimeout = 0;
@@ -454,10 +440,6 @@ const Searchbar = new Lang.Class({
             }));
         }));
 
-        this._searchEntry.connect('icon-release', Lang.bind(this, function() {
-            this._searchEntry.set_text('');
-        }));
-
         this.widget.insert(item, 0);
         this._searchEntry.set_text(Global.searchController.getString());
 



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