mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix initial down arrow in search box jumping two places
This commit is contained in:
parent
58dc106004
commit
89fa38c712
@ -213,10 +213,13 @@ class SearchBox2(QComboBox): # {{{
|
||||
if k in (Qt.Key_Enter, Qt.Key_Return):
|
||||
return self.do_search()
|
||||
if k not in (Qt.Key_Up, Qt.Key_Down):
|
||||
QComboBox.keyPressEvent(self, event)
|
||||
else:
|
||||
return QComboBox.keyPressEvent(self, event)
|
||||
self.blockSignals(True)
|
||||
self.normalize_state()
|
||||
if k == Qt.Key_Down and self.currentIndex() == 0 and not self.lineEdit().text():
|
||||
self.setCurrentIndex(1), self.setCurrentIndex(0)
|
||||
event.accept()
|
||||
return
|
||||
QComboBox.keyPressEvent(self, event)
|
||||
self.blockSignals(False)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user