From 1493a7909ca4fe267d9065de66da1fe1aa951e9d Mon Sep 17 00:00:00 2001 From: Julien Pivotto <roidelapluie@esquimaux.be> Date: Mon, 18 Apr 2011 11:36:42 +0200 Subject: [PATCH] add icon to roster filter --- data/gui/roster_window.ui | 6 +++++- src/roster_window.py | 7 +++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/data/gui/roster_window.ui b/data/gui/roster_window.ui index c10486ab4a..65f452421b 100644 --- a/data/gui/roster_window.ui +++ b/data/gui/roster_window.ui @@ -348,7 +348,11 @@ <property name="no_show_all">True</property> <property name="editable">False</property> <property name="can_focus">True</property> - <signal name="changed" handler="on_roster_filter_entry_changed" /> + <property name="primary_icon_stock">gtk-close</property> + <property name="primary_icon_activatable">True</property> + <signal name="changed" handler="on_roster_filter_entry_changed"/> + <signal name="icon_press" handler="on_roster_filter_entry_icon_press"/> + <signal name="key_press_event" handler="on_roster_filter_entry_key_press_event"/> </object> <packing> <property name="expand">False</property> diff --git a/src/roster_window.py b/src/roster_window.py index e61b8b6bfb..72ca0d565a 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -4176,12 +4176,19 @@ class RosterWindow: self.search_enabled = True self.refilter_shown_roster_items() + def on_roster_filter_entry_icon_press(self, widget): + pass + + def on_roster_filter_entry_key_press_event(self, widget): + pass + def on_show_roster_filter_menuitem_toggled(self, widget): """ Show the roster filter entry """ self.search_enabled = widget.get_active() self.xml.get_object('roster_filter_entry').set_visible(self.search_enabled) self.xml.get_object('roster_filter_entry').set_editable(self.search_enabled) if self.search_enabled: + self.xml.get_object('roster_filter_entry').set_text('') self.xml.get_object('roster_filter_entry').grab_focus() def on_roster_hpaned_notify(self, pane, gparamspec): -- GitLab