mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 22:23:25 +02:00
Fix return key not working in completion popup on OS X
This commit is contained in:
parent
1508b76c68
commit
274d3d4a13
1 changed files with 8 additions and 5 deletions
|
|
@ -185,11 +185,14 @@ def eventFilter(self, obj, e):
|
|||
e.accept()
|
||||
return True
|
||||
if key in (Qt.Key_Enter, Qt.Key_Return):
|
||||
if not self.currentIndex().isValid():
|
||||
self.hide()
|
||||
e.accept()
|
||||
return True
|
||||
return False
|
||||
# We handle this explicitly because on OS X activated() is
|
||||
# not emitted on pressing Enter.
|
||||
idx = self.currentIndex()
|
||||
if idx.isValid():
|
||||
self.item_chosen(idx)
|
||||
self.hide()
|
||||
e.accept()
|
||||
return True
|
||||
if key in (Qt.Key_PageUp, Qt.Key_PageDown):
|
||||
# Let the list view handle these keys
|
||||
return False
|
||||
|
|
|
|||
Loading…
Reference in a new issue