From 09a17f06e0770d059b8e6a44f88be9880885d0a8 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 6 Jul 2025 09:33:46 +0530 Subject: [PATCH] Completion combobox: have up/down arrow keys open the completion popup even when there is no current text --- src/calibre/gui2/complete2.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/calibre/gui2/complete2.py b/src/calibre/gui2/complete2.py index 51f9a52886..ca4409679e 100644 --- a/src/calibre/gui2/complete2.py +++ b/src/calibre/gui2/complete2.py @@ -508,6 +508,13 @@ class EditWithComplete(EnComboBox): finally: self.disable_popup = orig + def keyPressEvent(self, e): + if e.key() in (Qt.Key.Key_Down, Qt.Key.Key_Up) and not self.lineEdit().text() and not self.disable_popup: + e.accept() + self.showPopup() + return + super().keyPressEvent(e) + def update_items_cache(self, complete_items): self.lineEdit().update_items_cache(complete_items)