mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 02:50:46 -06:00
Implement page-wise scrolling in Browse Data tab
Don't scroll by 100 records when using the scroll buttons but scroll by one screen page. See issue #232.
This commit is contained in:
@@ -19,6 +19,7 @@ public:
|
||||
|
||||
public:
|
||||
QSet<int> selectedCols();
|
||||
int numVisibleRows();
|
||||
|
||||
public slots:
|
||||
void reloadSettings();
|
||||
@@ -30,7 +31,6 @@ signals:
|
||||
private:
|
||||
void copy();
|
||||
void paste();
|
||||
int numVisibleRows();
|
||||
|
||||
typedef QList<QByteArray> QByteArrayList;
|
||||
QList<QByteArrayList> m_buffer;
|
||||
|
||||
@@ -634,14 +634,14 @@ void MainWindow::selectTableLine(int lineToSelect)
|
||||
// Select it
|
||||
ui->dataTable->clearSelection();
|
||||
ui->dataTable->selectRow(lineToSelect);
|
||||
ui->dataTable->scrollTo(ui->dataTable->currentIndex());
|
||||
ui->dataTable->scrollTo(ui->dataTable->currentIndex(), QAbstractItemView::PositionAtTop);
|
||||
QApplication::restoreOverrideCursor();
|
||||
}
|
||||
|
||||
void MainWindow::navigatePrevious()
|
||||
{
|
||||
int curRow = ui->dataTable->currentIndex().row();
|
||||
curRow -= 100;
|
||||
curRow -= ui->dataTable->numVisibleRows() - 1;
|
||||
if(curRow < 0)
|
||||
curRow = 0;
|
||||
selectTableLine(curRow);
|
||||
@@ -651,7 +651,7 @@ void MainWindow::navigatePrevious()
|
||||
void MainWindow::navigateNext()
|
||||
{
|
||||
int curRow = ui->dataTable->currentIndex().row();
|
||||
curRow += 100;
|
||||
curRow += ui->dataTable->numVisibleRows() - 1;
|
||||
if(curRow >= m_browseTableModel->totalRowCount())
|
||||
curRow = m_browseTableModel->totalRowCount() - 1;
|
||||
selectTableLine(curRow);
|
||||
|
||||
Reference in New Issue
Block a user