mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Save and reestore scrollbar position on editing the items.
Save and restore scrollbar position on editing the dives. I think this is not the best place for it, but I'll leave it here for a while untill I find a better place. Fixes: #343 Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
9a497b1cb0
commit
5ac29bbe74
1 changed files with 3 additions and 1 deletions
|
@ -23,6 +23,7 @@
|
|||
#include <QSettings>
|
||||
#include <QTableView>
|
||||
#include <QPalette>
|
||||
#include <QScrollBar>
|
||||
|
||||
MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
|
||||
weightModel(new WeightModel()),
|
||||
|
@ -633,7 +634,7 @@ void MainTab::acceptChanges()
|
|||
if (d)
|
||||
fixup_dive(d);
|
||||
}
|
||||
|
||||
int scrolledBy = mainWindow()->dive_list()->verticalScrollBar()->sliderPosition();
|
||||
resetPallete();
|
||||
if(editMode == ADD || editMode == MANUALLY_ADDED_DIVE){
|
||||
mainWindow()->dive_list()->unselectDives();
|
||||
|
@ -659,6 +660,7 @@ void MainTab::acceptChanges()
|
|||
mainWindow()->refreshDisplay();
|
||||
mainWindow()->dive_list()->restoreSelection();
|
||||
}
|
||||
mainWindow()->dive_list()->verticalScrollBar()->setSliderPosition(scrolledBy);
|
||||
}
|
||||
|
||||
void MainTab::resetPallete()
|
||||
|
|
Loading…
Reference in a new issue