summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile
diff options
context:
space:
mode:
authorGravatar Joakim Bygdell <j.bygdell@gmail.com>2015-01-05 20:24:34 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-01-05 13:30:47 -0800
commit4b98d17800e95f78b154694117ab0c24d21ef148 (patch)
tree3f484b1caeb96e65270af66c00e4165b42386c2f /qt-ui/profile
parent88d806f2183480f227b21875ad4d9551d89b8b24 (diff)
downloadsubsurface-4b98d17800e95f78b154694117ab0c24d21ef148.tar.gz
Give oxygen a proper colour in the tankbar
Oxygen should be representad by its own solid green colour not the yellow/green of nitrox. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile')
-rw-r--r--qt-ui/profile/tankitem.cpp3
-rw-r--r--qt-ui/profile/tankitem.h2
2 files changed, 4 insertions, 1 deletions
diff --git a/qt-ui/profile/tankitem.cpp b/qt-ui/profile/tankitem.cpp
index 619368051..59acb28e0 100644
--- a/qt-ui/profile/tankitem.cpp
+++ b/qt-ui/profile/tankitem.cpp
@@ -23,6 +23,7 @@ TankItem::TankItem(QObject *parent) :
nitroxGradient.setColorAt(0.5, yellow);
nitroxGradient.setColorAt(1.0, yellow);
nitrox = nitroxGradient;
+ oxygen = green;
QLinearGradient trimixGradient(QPointF(0, 0), QPointF(0, height));
trimixGradient.setColorAt(0.0, green);
trimixGradient.setColorAt(0.49, green);
@@ -63,6 +64,8 @@ void TankItem::createBar(qreal x, qreal w, struct gasmix *gas)
rect->setBrush(air);
else if (gas->he.permille)
rect->setBrush(trimix);
+ else if (gas->o2.permille == 1000)
+ rect->setBrush(oxygen);
else
rect->setBrush(nitrox);
rect->setPen(QPen(QBrush(), 0.0)); // get rid of the thick line around the rectangle
diff --git a/qt-ui/profile/tankitem.h b/qt-ui/profile/tankitem.h
index d5c4b7f37..907bc0e34 100644
--- a/qt-ui/profile/tankitem.h
+++ b/qt-ui/profile/tankitem.h
@@ -33,7 +33,7 @@ private:
struct plot_data *pInfoEntry;
int pInfoNr;
qreal yPos, height;
- QBrush air, nitrox, trimix;
+ QBrush air, nitrox, oxygen, trimix;
QList<QGraphicsRectItem *> rects;
};