summaryrefslogtreecommitdiffstats
path: root/qt-ui/maintab.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-12-11 23:08:56 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-12-12 03:26:39 +0100
commit5ac29bbe74052ca530fa4bbb102b708ff08c1142 (patch)
tree8f75208e4a898f8e8bdbf7a131a3b89a0a622197 /qt-ui/maintab.cpp
parent9a497b1cb0f38e8a7e04e29543da5241a38d2195 (diff)
downloadsubsurface-5ac29bbe74052ca530fa4bbb102b708ff08c1142.tar.gz
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>
Diffstat (limited to 'qt-ui/maintab.cpp')
-rw-r--r--qt-ui/maintab.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index e9855bda7..edc425bfb 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -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()