New profile: improve mean depth line

Show decimal depth and make the line length more appropriate for the dive
profile shown.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2014-02-16 10:57:11 -08:00
parent e0f8ec7144
commit 582fb693a0
2 changed files with 3 additions and 2 deletions

View file

@ -531,8 +531,8 @@ void MeanDepthLine::setLine(qreal x1, qreal y1, qreal x2, qreal y2)
void MeanDepthLine::setMeanDepth(int value)
{
leftText->setText(get_depth_string(value, false, false));
rightText->setText(get_depth_string(value, false, false));
leftText->setText(get_depth_string(value, false, true));
rightText->setText(get_depth_string(value, false, true));
meanDepth = value;
}

View file

@ -347,6 +347,7 @@ void ProfileWidget2::plotDives(QList<dive*> dives)
cylinderPressureAxis->setMinimum(pInfo.minpressure);
cylinderPressureAxis->setMaximum(pInfo.maxpressure);
meanDepth->setMeanDepth(pInfo.meandepth);
meanDepth->setLine(0,0,timeAxis->posAtValue(d->duration.seconds),0);
meanDepth->animateMoveTo(3, profileYAxis->posAtValue(pInfo.meandepth));
dataModel->emitDataChanged();