mirror of
https://github.com/ankitects/anki.git
synced 2025-09-23 08:22:24 -04:00
scroll to newly added column in browser (#978)
This commit is contained in:
parent
0f7000db83
commit
174914b7dc
1 changed files with 7 additions and 0 deletions
|
@ -695,12 +695,19 @@ by clicking on one on the left."""))
|
|||
if len(self.model.activeCols) < 2:
|
||||
return showInfo(_("You must have at least one column."))
|
||||
self.model.activeCols.remove(type)
|
||||
adding=False
|
||||
else:
|
||||
self.model.activeCols.append(type)
|
||||
adding=True
|
||||
# sorted field may have been hidden
|
||||
self.setSortIndicator()
|
||||
self.setColumnSizes()
|
||||
self.model.endReset()
|
||||
# if we added a column, scroll to it
|
||||
if adding:
|
||||
row = self.currentRow()
|
||||
idx = self.model.index(row, len(self.model.activeCols) - 1)
|
||||
self.form.tableView.scrollTo(idx)
|
||||
|
||||
def setColumnSizes(self):
|
||||
hh = self.form.tableView.horizontalHeader()
|
||||
|
|
Loading…
Reference in a new issue