mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
minor follow-up to #1257
No need for a separate argument, as we only want to scroll when searching.
This commit is contained in:
parent
f8f6b828aa
commit
45b790ec3c
1 changed files with 3 additions and 4 deletions
|
@ -215,17 +215,16 @@ class SidebarTreeView(QTreeView):
|
|||
# start from a collapsed state, as it's faster
|
||||
self.collapseAll()
|
||||
self.setColumnHidden(0, not self.model().search(text))
|
||||
self._expand_where_necessary(
|
||||
self.model(), searching=True, scroll_to_first_match=True
|
||||
)
|
||||
self._expand_where_necessary(self.model(), searching=True)
|
||||
|
||||
def _expand_where_necessary(
|
||||
self,
|
||||
model: SidebarModel,
|
||||
parent: Optional[QModelIndex] = None,
|
||||
searching: bool = False,
|
||||
scroll_to_first_match: bool = False,
|
||||
) -> None:
|
||||
scroll_to_first_match = searching
|
||||
|
||||
def expand_node(parent: QModelIndex) -> None:
|
||||
nonlocal scroll_to_first_match
|
||||
|
||||
|
|
Loading…
Reference in a new issue