From 4c01a4b508b9b9acc0a7cf92a6aad999d7405570 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 20 Oct 2009 18:17:53 -0600 Subject: [PATCH] Fix #3816 (Search Bar Right Click Issue) --- src/calibre/gui2/search_box.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/search_box.py b/src/calibre/gui2/search_box.py index 11a10d9b95..baee2a2bc2 100644 --- a/src/calibre/gui2/search_box.py +++ b/src/calibre/gui2/search_box.py @@ -6,7 +6,7 @@ __license__ = 'GPL v3' __copyright__ = '2009, Kovid Goyal ' __docformat__ = 'restructuredtext en' -from PyQt4.Qt import QComboBox, SIGNAL, Qt, QLineEdit, QStringList +from PyQt4.Qt import QComboBox, SIGNAL, Qt, QLineEdit, QStringList, pyqtSlot from calibre.gui2 import config @@ -25,6 +25,17 @@ class SearchLineEdit(QLineEdit): self.parent().normalize_state() return QLineEdit.dropEvent(self, ev) + def contextMenuEvent(self, ev): + if self.parent().help_state: + self.parent().normalize_state() + return QLineEdit.contextMenuEvent(self, ev) + + @pyqtSlot() + def paste(self, *args): + if self.parent().help_state: + self.parent().normalize_state() + return QLineEdit.paste(self) + class SearchBox2(QComboBox): '''