diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2014-02-12 13:50:35 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-02-12 10:08:46 -0800 |
commit | b08c38da3330b5dcbefe2a88ef60df27e5bf20a3 (patch) | |
tree | a86d9fbfba8635dacc0863243d5f6bf29af6b4a2 /qt-ui/profile/profilewidget2.cpp | |
parent | 5ca13b0024abdd7e8c687be90d62db97d7f5b8af (diff) | |
download | subsurface-b08c38da3330b5dcbefe2a88ef60df27e5bf20a3.tar.gz |
Animate transition between show / hide partial pressure graphs
When the user checked the option to show or hide the partial
presure graph the size of the profile graph was kept the same;
usually I do those changes on the objects themselves, on the
settingsChanged method, but since the calculation of the
size of the profile was done on the ProfileView class for
consistency with the other objects, I had to change it there
too.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/profilewidget2.cpp')
-rw-r--r-- | qt-ui/profile/profilewidget2.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index 33f7be4cd..b0c985653 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -22,6 +22,7 @@ #include <QTableView> #endif #include "mainwindow.h" +#include <preferences.h> /* This is the global 'Item position' variable. * it should tell you where to position things up @@ -82,6 +83,7 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) : addItemsToScene(); scene()->installEventFilter(this); setEmptyState(); + connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), this, SLOT(settingsChanged())); #ifndef QT_NO_DEBUG QTableView *diveDepthTableView = new QTableView(); @@ -359,6 +361,13 @@ void ProfileWidget2::plotDives(QList<dive*> dives) void ProfileWidget2::settingsChanged() { + QSettings s; + s.beginGroup("TecDetails"); + if(s.value("phegraph").toBool()|| s.value("po2graph").toBool()|| s.value("pn2graph").toBool()){ + profileYAxis->animateChangeLine(itemPos.depth.shrinked); + }else{ + profileYAxis->animateChangeLine(itemPos.depth.expanded); + } } void ProfileWidget2::resizeEvent(QResizeEvent* event) |