diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2014-02-12 14:24:19 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-02-12 10:31:24 -0800 |
commit | 0333de426ff0d581a3e4534f3999daf17349c4b5 (patch) | |
tree | 684b2483ba0ba69bbce50c61ab26c5ccb0280910 /qt-ui/profile/divecartesianaxis.cpp | |
parent | 8041a2ed856f88345032cda7d8b309c52910ed47 (diff) | |
download | subsurface-0333de426ff0d581a3e4534f3999daf17349c4b5.tar.gz |
Hide the extra axis labels on release mode, show on debug mode.
The extra axis labels on the Temperature and Cylinder Pressure
graphs are not wanted in release mode as they create a lot of visual
clutter, but they are useful to have in debug mode since we can then
better understand what went wrong.
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.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/qt-ui/profile/divecartesianaxis.cpp b/qt-ui/profile/divecartesianaxis.cpp index 3fdafa375..6eb732139 100644 --- a/qt-ui/profile/divecartesianaxis.cpp +++ b/qt-ui/profile/divecartesianaxis.cpp @@ -67,7 +67,8 @@ DiveCartesianAxis::DiveCartesianAxis() : QObject(), min(0), max(0), interval(1), - tick_size(0) + tick_size(0), + textVisibility(true) { setPen(gridPen()); } @@ -87,6 +88,17 @@ QColor DiveCartesianAxis::colorForValue(double value) return QColor(Qt::black); } +void DiveCartesianAxis::setTextVisible(bool arg1) +{ + if(textVisibility == arg1){ + return; + } + textVisibility = arg1; + Q_FOREACH(DiveTextItem *item, labels){ + item->setVisible(textVisibility); + } +} + void DiveCartesianAxis::updateTicks() { if (!scene()) @@ -163,6 +175,10 @@ void DiveCartesianAxis::updateTicks() label->animateMoveTo(m.x1() - tick_size, childPos); } } + + Q_FOREACH(DiveTextItem *item, labels){ + item->setVisible(textVisibility); + } } void DiveCartesianAxis::animateChangeLine(const QLineF& newLine) |