From b08c38da3330b5dcbefe2a88ef60df27e5bf20a3 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Wed, 12 Feb 2014 13:50:35 -0200 Subject: 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 Signed-off-by: Dirk Hohndel --- qt-ui/profile/profilewidget2.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'qt-ui/profile/profilewidget2.cpp') 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 #endif #include "mainwindow.h" +#include /* 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 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) -- cgit v1.2.3-70-g09d2