Fix #3816 (Search Bar Right Click Issue)

This commit is contained in:
Kovid Goyal 2009-10-20 18:17:53 -06:00
parent 86a2034279
commit 4c01a4b508

View File

@ -6,7 +6,7 @@ __license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__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):
'''