summaryrefslogtreecommitdiffstats
path: root/profile-widget/divetooltipitem.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2016-11-01 17:00:06 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-11-01 09:41:17 -0700
commit37e3e7e69a289db8c435a9d87188267c06703e11 (patch)
treeaf124abd81fbc9a45f01517c40046a34bf7e7f22 /profile-widget/divetooltipitem.cpp
parentc110b4a23809ef7702653383d666bdd7a48ee775 (diff)
downloadsubsurface-37e3e7e69a289db8c435a9d87188267c06703e11.tar.gz
Deco mode for plannining is not deco mode for showing
We had (in the wrong place, imo) a new feature that should differentiate the different deco_modes, you could plan your dive in buelhman and see it in vpm-b, for instance but both of them accessed the same pref. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'profile-widget/divetooltipitem.cpp')
-rw-r--r--profile-widget/divetooltipitem.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/profile-widget/divetooltipitem.cpp b/profile-widget/divetooltipitem.cpp
index cb46e898c..e55ceb269 100644
--- a/profile-widget/divetooltipitem.cpp
+++ b/profile-widget/divetooltipitem.cpp
@@ -263,8 +263,11 @@ void ToolTipItem::refresh(const QPointF &pos)
painter.setBrush(QColor(Qt::red));
painter.drawRect(0,0,16,10);
if (entry) {
+ ProfileWidget2 *view = qobject_cast<ProfileWidget2*>(scene()->views().first());
+ Q_ASSERT(view);
+
painter.setPen(QColor(0, 0, 0, 255));
- if (prefs.deco_mode == BUEHLMANN)
+ if ((view->currentState == ProfileWidget2::PLAN && prefs.deco_mode == BUEHLMANN) || prefs.display_deco_mode == BUEHLMANN)
painter.drawLine(0, 60 - entry->gfline / 2, 16, 60 - entry->gfline / 2);
painter.drawLine(0, 60 - AMB_PERCENTAGE * (entry->pressures.n2 + entry->pressures.he) / entry->ambpressure / 2,
16, 60 - AMB_PERCENTAGE * (entry->pressures.n2 + entry->pressures.he) / entry->ambpressure /2);