Scroll list of completion to current match when clicking combobox drop down arrow

This commit is contained in:
Kovid Goyal 2012-07-02 20:51:04 +05:30
commit 024f2776b2

View File

@ -165,8 +165,18 @@ class MultiCompleteComboBox(EnComboBox):
def showPopup(self): def showPopup(self):
c = self.le._completer c = self.le._completer
v = c.currentCompletion()
c.setCompletionPrefix('') c.setCompletionPrefix('')
c.complete() c.complete()
cs = c.caseSensitivity()
i = 0
while c.setCurrentRow(i):
cr = c.currentIndex().data().toString()
if cr.startsWith(v, cs):
c.popup().setCurrentIndex(c.currentIndex())
return
i += 1
c.setCurrentRow(0)
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)