Scroll to first item when wrapping completion

This commit is contained in:
Florian Bruhin 2014-04-30 13:52:16 +02:00
parent 57604ad8e4
commit b04adca059

View File

@ -163,7 +163,9 @@ class CompletionView(QTreeView):
if not idx.isValid() and upwards:
return self._model.last_item()
elif not idx.isValid() and not upwards:
return self._model.first_item()
idx = self._model.first_item()
self.scrollTo(idx.parent())
return idx
elif idx.parent().isValid():
# Item is a real item, not a category header -> success
return idx