mirror of
https://github.com/ankitects/anki.git
synced 2025-11-06 12:47:11 -05:00
don't wait before scrolling to current card
https://github.com/ankitects/anki/pull/1222#discussion_r647017566
This commit is contained in:
parent
6878d4ca24
commit
afaaa763ec
2 changed files with 3 additions and 5 deletions
|
|
@ -106,9 +106,9 @@ class Browser(QMainWindow):
|
|||
self.setupEditor()
|
||||
# disable undo/redo
|
||||
self.on_undo_state_change(mw.undo_actions_info())
|
||||
self.setupSearch(card, search)
|
||||
gui_hooks.browser_will_show(self)
|
||||
self.show()
|
||||
self.setupSearch(card, search)
|
||||
|
||||
def on_operation_did_execute(
|
||||
self, changes: OpChanges, handler: Optional[object]
|
||||
|
|
|
|||
|
|
@ -129,8 +129,7 @@ class Table:
|
|||
self.clear_selection()
|
||||
if (row := self._model.get_card_row(card_id)) is not None:
|
||||
self._view.selectRow(row)
|
||||
# editor may pop up and hide the row later on
|
||||
QTimer.singleShot(100, lambda: self._scroll_to_row(row))
|
||||
self._scroll_to_row(row)
|
||||
|
||||
# Reset
|
||||
|
||||
|
|
@ -408,8 +407,7 @@ class Table:
|
|||
current = current or rows[0]
|
||||
self._select_rows(rows)
|
||||
self._set_current(current)
|
||||
# editor may pop up and hide the row later on
|
||||
QTimer.singleShot(100, lambda: self._scroll_to_row(current))
|
||||
self._scroll_to_row(current)
|
||||
if self.len_selection() == 0:
|
||||
# no row change will fire
|
||||
self.browser.onRowChanged(QItemSelection(), QItemSelection())
|
||||
|
|
|
|||
Loading…
Reference in a new issue