Completion combobox: have up/down arrow keys open the completion popup even when there is no current text

This commit is contained in:
Kovid Goyal 2025-07-06 09:33:46 +05:30
parent 4bffaa147a
commit 09a17f06e0
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -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)