summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/divecartesianaxis.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2014-01-19 20:14:48 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-01-19 21:38:10 -0800
commitedad8712b97781ae8952fe5905cb337ecc0be9ea (patch)
treedcd8017937acf90745c7f91c397df97d0c35a9e6 /qt-ui/profile/divecartesianaxis.cpp
parentcd3867d46abdc3c19368b7370b4fa1c3b71d0e1d (diff)
downloadsubsurface-edad8712b97781ae8952fe5905cb337ecc0be9ea.tar.gz
Make the colors of the texts be prettier.
Just fixes some colors of the texts on the canvas. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/divecartesianaxis.cpp')
-rw-r--r--qt-ui/profile/divecartesianaxis.cpp29
1 files changed, 28 insertions, 1 deletions
diff --git a/qt-ui/profile/divecartesianaxis.cpp b/qt-ui/profile/divecartesianaxis.cpp
index 4c7b608f8..fdcfff3c6 100644
--- a/qt-ui/profile/divecartesianaxis.cpp
+++ b/qt-ui/profile/divecartesianaxis.cpp
@@ -10,6 +10,13 @@
#include <QGraphicsView>
#include <QStyleOption>
+static QPen gridPen(){
+ QPen pen;
+ pen.setColor(getColor(TIME_GRID));
+ pen.setWidth(2);
+ pen.setCosmetic(true);
+ return pen;
+}
void DiveCartesianAxis::setMaximum(double maximum)
{
max = maximum;
@@ -29,7 +36,7 @@ void DiveCartesianAxis::setTextColor(const QColor& color)
DiveCartesianAxis::DiveCartesianAxis() : orientation(LeftToRight), showTicks(true), showText(true)
{
-
+ setPen(gridPen());
}
DiveCartesianAxis::~DiveCartesianAxis()
@@ -42,6 +49,11 @@ void DiveCartesianAxis::setOrientation(Orientation o)
orientation = o;
}
+QColor DiveCartesianAxis::colorForValue(double value)
+{
+ return QColor(Qt::black);
+}
+
void DiveCartesianAxis::updateTicks()
{
QLineF m = line();
@@ -108,6 +120,7 @@ void DiveCartesianAxis::updateTicks()
label = new DiveTextItem(this);
label->setText(textForValue(currValue));
label->setBrush(QBrush(textColor));
+ label->setBrush(colorForValue(currValue));
}
labels.push_back(label);
if (orientation == RightToLeft || orientation == LeftToRight) {
@@ -223,6 +236,18 @@ QString DepthAxis::textForValue(double value)
return get_depth_string(value, false, false);
}
+QColor DepthAxis::colorForValue(double value)
+{
+ Q_UNUSED(value);
+ return QColor(Qt::red);
+}
+
+QColor TimeAxis::colorForValue(double value)
+{
+ Q_UNUSED(value);
+ return QColor(Qt::blue);
+}
+
QString TimeAxis::textForValue(double value)
{
return QString::number(value / 60);
@@ -303,6 +328,7 @@ void DiveCartesianPlane::setup()
line->setLine(0, 0, horizontalSize, 0);
line->setPos(left,leftAxis->posAtValue(i));
line->setZValue(-1);
+ line->setPen(gridPen());
horizontalLines.push_back(line);
scene()->addItem(line);
}
@@ -312,6 +338,7 @@ void DiveCartesianPlane::setup()
line->setLine(0, 0, 0, verticalSize);
line->setPos(bottomAxis->posAtValue(i), top);
line->setZValue(-1);
+ line->setPen(gridPen());
verticalLines.push_back(line);
scene()->addItem(line);
}