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>
This commit is contained in:
Tomaz Canabrava 2014-02-12 13:50:35 -02:00 committed by Dirk Hohndel
parent 5ca13b0024
commit b08c38da33

View file

@ -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)