mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-21 03:35:26 +01:00
complete2: Prevent mouse moving in from the bottom of the list changing the scroll position of the list
This commit is contained in:
parent
4166178747
commit
c75d9b55ee
1 changed files with 8 additions and 1 deletions
|
|
@ -115,7 +115,14 @@ def set_completion_prefix(self, prefix):
|
|||
self.relayout_needed.emit()
|
||||
|
||||
def item_entered(self, idx):
|
||||
self.setCurrentIndex(idx)
|
||||
if self.visualRect(idx).top() < self.viewport().rect().bottom() - 5:
|
||||
# Prevent any bottom item in the list that is only partially
|
||||
# visible from triggering setCurrentIndex()
|
||||
self.entered.disconnect()
|
||||
try:
|
||||
self.setCurrentIndex(idx)
|
||||
finally:
|
||||
self.entered.connect(self.item_entered)
|
||||
|
||||
def next_match(self, previous=False):
|
||||
c = self.currentIndex()
|
||||
|
|
|
|||
Loading…
Reference in a new issue