mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
Fix return key not working in completion popup on OS X
This commit is contained in:
parent
1508b76c68
commit
274d3d4a13
@ -185,11 +185,14 @@ class Completer(QListView): # {{{
|
|||||||
e.accept()
|
e.accept()
|
||||||
return True
|
return True
|
||||||
if key in (Qt.Key_Enter, Qt.Key_Return):
|
if key in (Qt.Key_Enter, Qt.Key_Return):
|
||||||
if not self.currentIndex().isValid():
|
# We handle this explicitly because on OS X activated() is
|
||||||
self.hide()
|
# not emitted on pressing Enter.
|
||||||
e.accept()
|
idx = self.currentIndex()
|
||||||
return True
|
if idx.isValid():
|
||||||
return False
|
self.item_chosen(idx)
|
||||||
|
self.hide()
|
||||||
|
e.accept()
|
||||||
|
return True
|
||||||
if key in (Qt.Key_PageUp, Qt.Key_PageDown):
|
if key in (Qt.Key_PageUp, Qt.Key_PageDown):
|
||||||
# Let the list view handle these keys
|
# Let the list view handle these keys
|
||||||
return False
|
return False
|
||||||
|
Loading…
x
Reference in New Issue
Block a user