mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Completion combobox: have up/down arrow keys open the completion popup even when there is no current text
This commit is contained in:
parent
4bffaa147a
commit
09a17f06e0
@ -508,6 +508,13 @@ class EditWithComplete(EnComboBox):
|
|||||||
finally:
|
finally:
|
||||||
self.disable_popup = orig
|
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):
|
def update_items_cache(self, complete_items):
|
||||||
self.lineEdit().update_items_cache(complete_items)
|
self.lineEdit().update_items_cache(complete_items)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user