From 2353f958d39077dbd2f22795ee56bca79e52f846 Mon Sep 17 00:00:00 2001 From: hordepfo Date: Wed, 22 Jan 2014 03:15:15 +0000 Subject: [PATCH] Correction of previous commit - clear when clicked Now category buttons only clear text when clicked, not when hovered. It seems more natural, because a now the mouse position is irrelevant when trying to type on the search entry. --- usr/lib/linuxmint/mintMenu/plugins/applications.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/usr/lib/linuxmint/mintMenu/plugins/applications.py b/usr/lib/linuxmint/mintMenu/plugins/applications.py index 6191780..272f852 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/applications.py +++ b/usr/lib/linuxmint/mintMenu/plugins/applications.py @@ -880,6 +880,10 @@ class pluginclass( object ): widget.set_relief( Gtk.ReliefStyle.HALF ) self.applicationsScrolledWindow.get_vadjustment().set_value( 0 ) + + def FilterAndClear( self, widget, category = None ): + self.searchEntry.set_text( "" ) + self.Filter( widget, category ) # Forward all text to the search box def keyPress( self, widget, event ): @@ -1673,7 +1677,7 @@ class pluginclass( object ): else: item["button"].mouseOverHandlerIds = None - item["button"].connect( "clicked", self.Filter, item["filter"] ) + item["button"].connect( "clicked", self.FilterAndClear, item["filter"] ) item["button"].connect( "focus-in-event", self.categoryBtnFocus, item["filter"] ) item["button"].show()