[gedit] quickopen: use GtkSearchEntry



commit 7fb4bb149a249811b5974c37300cea5eea9182c1
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Wed Jun 20 18:10:48 2012 +0200

    quickopen: use GtkSearchEntry

 plugins/quickopen/quickopen/popup.py |   21 +--------------------
 1 files changed, 1 insertions(+), 20 deletions(-)
---
diff --git a/plugins/quickopen/quickopen/popup.py b/plugins/quickopen/quickopen/popup.py
index 034eca0..237a8c9 100644
--- a/plugins/quickopen/quickopen/popup.py
+++ b/plugins/quickopen/quickopen/popup.py
@@ -68,13 +68,11 @@ class Popup(Gtk.Dialog):
         action_area.set_border_width(5)
         action_area.set_spacing(6)
 
-        self._entry = Gtk.Entry()
+        self._entry = Gtk.SearchEntry()
         self._entry.set_placeholder_text(_('Type to search...'))
-        self.set_entry_icon(self._entry)
 
         self._entry.connect('changed', self.on_changed)
         self._entry.connect('key-press-event', self.on_key_press_event)
-        self._entry.connect('icon-press', self.on_icon_press)
 
         sw = Gtk.ScrolledWindow()
         sw.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
@@ -365,24 +363,10 @@ class Popup(Gtk.Dialog):
 
         self.do_search()
 
-    def set_entry_icon(self, entry):
-        if entry.get_text() == "":
-            icon = Gio.ThemedIcon.new_with_default_fallbacks("edit-find-symbolic")
-            entry.set_icon_activatable(Gtk.EntryIconPosition.SECONDARY, False)
-            entry.set_icon_sensitive(Gtk.EntryIconPosition.SECONDARY, False)
-        else:
-            icon = Gio.ThemedIcon.new_with_default_fallbacks("edit-clear-symbolic")
-            entry.set_icon_activatable(Gtk.EntryIconPosition.SECONDARY, True)
-            entry.set_icon_sensitive(Gtk.EntryIconPosition.SECONDARY, True)
-
-        entry.set_icon_from_gicon(Gtk.EntryIconPosition.SECONDARY, icon)
-
     def on_changed(self, editable):
         self.do_search()
         self.on_selection_changed(self._treeview.get_selection())
 
-        self.set_entry_icon(editable)
-
     def _shift_extend(self, towhere):
         selection = self._treeview.get_selection()
 
@@ -533,9 +517,6 @@ class Popup(Gtk.Dialog):
 
         return False
 
-    def on_icon_press(self, entry, icon_pos, event):
-        entry.set_text("")
-
     def on_row_activated(self, view, path, column):
         self._activate()
 



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