summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/diveprofileitem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/profile/diveprofileitem.cpp')
-rw-r--r--qt-ui/profile/diveprofileitem.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/qt-ui/profile/diveprofileitem.cpp b/qt-ui/profile/diveprofileitem.cpp
index 51d6a3f79..52cf3d91b 100644
--- a/qt-ui/profile/diveprofileitem.cpp
+++ b/qt-ui/profile/diveprofileitem.cpp
@@ -581,8 +581,14 @@ void DiveReportedCeiling::modelDataChanged(const QModelIndex &topLeft, const QMo
}
setPolygon(p);
QLinearGradient pat(0, p.boundingRect().top(), 0, p.boundingRect().bottom());
- pat.setColorAt(0, getColor(CEILING_SHALLOW));
- pat.setColorAt(1, getColor(CEILING_DEEP));
+ // does the user want the ceiling in "surface color" or in red?
+ if (prefs.profile_red_ceiling) {
+ pat.setColorAt(0, getColor(CEILING_SHALLOW));
+ pat.setColorAt(1, getColor(CEILING_DEEP));
+ } else {
+ pat.setColorAt(0, getColor(BACKGROUND_TRANS));
+ pat.setColorAt(1, getColor(BACKGROUND_TRANS));
+ }
setPen(QPen(QBrush(Qt::NoBrush), 0));
setBrush(pat);
}
@@ -605,7 +611,7 @@ void DiveReportedCeiling::preferencesChanged()
{
QSettings s;
s.beginGroup("TecDetails");
- setVisible(s.value("redceiling").toBool());
+ setVisible(s.value("dcceiling").toBool());
}
void DiveReportedCeiling::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)