From 169589413056c8c76f52de5db662fe2269ff8c65 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Thu, 27 Feb 2014 12:39:53 -0300 Subject: New profile: connect the scale action Just quick'n dirty glue code so that when the user clicks on the 'scale' toolbar item, the new profile graphic is scaled. Lovely thing: Animations for free. <3 Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/profile/profilewidget2.cpp | 9 ++++++++- qt-ui/profile/profilewidget2.h | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index 3cb9fb20f..2ec069452 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -77,7 +77,8 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) : pheGasItem( new PartialPressureGasItem()), po2GasItem( new PartialPressureGasItem()), heartBeatAxis(new DiveCartesianAxis()), - heartBeatItem(new DiveHeartrateItem()) + heartBeatItem(new DiveHeartrateItem()), + isPlotZoomed(prefs.zoomed_plot) { memset(&plotInfo, 0, sizeof(plotInfo)); @@ -421,6 +422,12 @@ void ProfileWidget2::settingsChanged() temperatureAxis->animateChangeLine(itemPos.temperature.expanded); cylinderPressureAxis->animateChangeLine(itemPos.cylinder.expanded); } + if(s.value("zoomed_plot").toBool() != isPlotZoomed){ + isPlotZoomed = s.value("zoomed_plot").toBool(); + int diveId = dataModel->id(); + dataModel->clear(); + plotDives(QList() << getDiveById(diveId)); + } } void ProfileWidget2::resizeEvent(QResizeEvent* event) diff --git a/qt-ui/profile/profilewidget2.h b/qt-ui/profile/profilewidget2.h index 31f806451..2b5d19d71 100644 --- a/qt-ui/profile/profilewidget2.h +++ b/qt-ui/profile/profilewidget2.h @@ -77,6 +77,7 @@ private: DivePixmapItem *background; QString backgroundFile; ToolTipItem *toolTipItem; + bool isPlotZoomed; // All those here should probably be merged into one structure, // So it's esyer to replicate for more dives later. // In the meantime, keep it here. -- cgit v1.2.3-70-g09d2