Ensure mouse is at current index before searching
Thus, no search will be triggered when clicking an expansion indicator as this doesn't update the current element. However, if the indicator belongs to the current item, a search will be triggered anyway.
This commit is contained in:
parent
a9ea7e39ae
commit
9a844591fe
@ -545,8 +545,8 @@ class SidebarTreeView(QTreeView):
|
||||
def mouseReleaseEvent(self, event: QMouseEvent) -> None:
|
||||
super().mouseReleaseEvent(event)
|
||||
if self.tool == SidebarTool.SEARCH and event.button() == Qt.LeftButton:
|
||||
idx = self.indexAt(event.pos())
|
||||
self._on_search(idx)
|
||||
if (index := self.currentIndex()) == self.indexAt(event.pos()):
|
||||
self._on_search(index)
|
||||
|
||||
def keyPressEvent(self, event: QKeyEvent) -> None:
|
||||
index = self.currentIndex()
|
||||
|
Loading…
Reference in New Issue
Block a user