aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/profile
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
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')
-rw-r--r--qt-ui/profile/divecartesianaxis.cpp29
-rw-r--r--qt-ui/profile/divecartesianaxis.h4
2 files changed, 31 insertions, 2 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);
}
diff --git a/qt-ui/profile/divecartesianaxis.h b/qt-ui/profile/divecartesianaxis.h
index e03df04e3..b2aecbf79 100644
--- a/qt-ui/profile/divecartesianaxis.h
+++ b/qt-ui/profile/divecartesianaxis.h
@@ -36,7 +36,7 @@ signals:
void sizeChanged();
protected:
virtual QString textForValue(double value);
-
+ virtual QColor colorForValue(double value);
Orientation orientation;
QList<DiveTextItem*> labels;
double min;
@@ -51,11 +51,13 @@ protected:
class DepthAxis : public DiveCartesianAxis {
protected:
QString textForValue(double value);
+ QColor colorForValue(double value);
};
class TimeAxis : public DiveCartesianAxis {
protected:
QString textForValue(double value);
+ QColor colorForValue(double value);
};
class TemperatureAxis : public DiveCartesianAxis{