From 35cca4e6cf9833de2a3627fab6432d5b7ee1d0bc Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 11 Feb 2014 23:31:13 +0530 Subject: [PATCH] Completion popups: Allow pressing Tab (in addition to Enter) to accept the current completion --- src/calibre/gui2/complete2.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/calibre/gui2/complete2.py b/src/calibre/gui2/complete2.py index 659d965dbd..8aa28069f8 100644 --- a/src/calibre/gui2/complete2.py +++ b/src/calibre/gui2/complete2.py @@ -207,6 +207,15 @@ class Completer(QListView): # {{{ self.hide() e.accept() return True + if key == Qt.Key_Tab: + idx = self.currentIndex() + if idx.isValid(): + self.item_chosen(idx) + self.hide() + elif self.model().rowCount() > 0: + self.next_match() + e.accept() + return True if key in (Qt.Key_PageUp, Qt.Key_PageDown): # Let the list view handle these keys return False