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,12 +213,15 @@ class SearchBox2(QComboBox): # {{{
|
|||||||
if k in (Qt.Key_Enter, Qt.Key_Return):
|
if k in (Qt.Key_Enter, Qt.Key_Return):
|
||||||
return self.do_search()
|
return self.do_search()
|
||||||
if k not in (Qt.Key_Up, Qt.Key_Down):
|
if k not in (Qt.Key_Up, Qt.Key_Down):
|
||||||
QComboBox.keyPressEvent(self, event)
|
return QComboBox.keyPressEvent(self, event)
|
||||||
else:
|
self.blockSignals(True)
|
||||||
self.blockSignals(True)
|
self.normalize_state()
|
||||||
self.normalize_state()
|
if k == Qt.Key_Down and self.currentIndex() == 0 and not self.lineEdit().text():
|
||||||
QComboBox.keyPressEvent(self, event)
|
self.setCurrentIndex(1), self.setCurrentIndex(0)
|
||||||
self.blockSignals(False)
|
event.accept()
|
||||||
|
return
|
||||||
|
QComboBox.keyPressEvent(self, event)
|
||||||
|
self.blockSignals(False)
|
||||||
|
|
||||||
def completer_used(self, text):
|
def completer_used(self, text):
|
||||||
self.timer.stop()
|
self.timer.stop()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user