Merge branch 'master' of github.com:dae/anki

This commit is contained in:
Damien Elmes 2016-07-04 16:33:03 +10:00
commit 058fc373bd
2 changed files with 9 additions and 1 deletions

View File

@ -863,8 +863,12 @@ $(function () {
}
}
conf.yaxis.minTickSize = 1;
// prevent ticks from having decimals (use whole numbers instead)
conf.yaxis.tickDecimals = 0;
conf.yaxis.tickFormatter = function (val, axis) {
return val.toFixed(0);
// Just in case we get ticks with decimals, render to one decimal position. If it's
// a whole number then render without any decimal (i.e. without the trailing .0).
return val === Math.round(val) ? val.toFixed(0) : val.toFixed(1);
}
if (conf.series.pie) {
conf.series.pie.label.formatter = function(label, series){

View File

@ -189,7 +189,11 @@ class DataModel(QAbstractTableModel):
tv = self.browser.form.tableView
if idx:
tv.selectRow(idx.row())
# we save and then restore the horizontal scroll position because
# scrollTo() also scrolls horizontally which is confusing
h = tv.horizontalScrollBar().value()
tv.scrollTo(idx, tv.PositionAtCenter)
tv.horizontalScrollBar().setValue(h)
if count < 500:
# discard large selections; they're too slow
sm.select(items, QItemSelectionModel.SelectCurrent |