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>
This commit is contained in:
Joakim Bygdell 2015-01-05 20:24:34 +01:00 committed by Dirk Hohndel
parent 88d806f218
commit 4b98d17800
2 changed files with 4 additions and 1 deletions

View file

@ -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

View file

@ -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;
};