mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
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 <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
8c56b2f45e
commit
1695894130
2 changed files with 9 additions and 1 deletions
|
@ -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<dive*>() << getDiveById(diveId));
|
||||
}
|
||||
}
|
||||
|
||||
void ProfileWidget2::resizeEvent(QResizeEvent* event)
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue