mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Select the first matching completion when opening a combobox completion popup
This commit is contained in:
parent
61270a77dd
commit
6d165cbb61
@ -164,9 +164,19 @@ class MultiCompleteComboBox(EnComboBox):
|
||||
self.setLineEdit(self.le)
|
||||
|
||||
def showPopup(self):
|
||||
print 'here'
|
||||
c = self.le._completer
|
||||
v = unicode(c.currentCompletion())
|
||||
print v
|
||||
c.setCompletionPrefix('')
|
||||
c.complete()
|
||||
i = 0;
|
||||
while c.setCurrentRow(i):
|
||||
cr = unicode(c.currentIndex().data().toString())
|
||||
if cr.startswith(v):
|
||||
c.popup().setCurrentIndex(c.currentIndex())
|
||||
return
|
||||
i += 1
|
||||
|
||||
def update_items_cache(self, complete_items):
|
||||
self.lineEdit().update_items_cache(complete_items)
|
||||
|
Loading…
x
Reference in New Issue
Block a user