aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2014-01-27 17:18:35 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-01-28 11:31:40 -0800
commit607bf479897f5216d8c95bbf4353e544e05adafe (patch)
treebd19252a73dee08724492f5ef860420650392fe5
parent9f6ebf96a73c9663ea20a8c3e245bc3d9a4f3747 (diff)
downloadsubsurface-607bf479897f5216d8c95bbf4353e544e05adafe.tar.gz
Fix an issue added in the last commit
The last commit made the time and all other axis behave like the time axis. Not cool. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/profile/divecartesianaxis.cpp12
-rw-r--r--qt-ui/profile/divecartesianaxis.h5
2 files changed, 14 insertions, 3 deletions
diff --git a/qt-ui/profile/divecartesianaxis.cpp b/qt-ui/profile/divecartesianaxis.cpp
index 5b7f9cfad..9a3c8242f 100644
--- a/qt-ui/profile/divecartesianaxis.cpp
+++ b/qt-ui/profile/divecartesianaxis.cpp
@@ -110,7 +110,6 @@ void DiveCartesianAxis::updateTicks()
} else {
labels[i]->animateMoveTo(m.x1() - tickSize, childPos);
}
- labels[i]->setVisible( i % 2 );
}
// Add's the rest of the needed Ticks / Text.
@@ -143,7 +142,6 @@ void DiveCartesianAxis::updateTicks()
label->animateMoveTo(m.x1() - tickSize, childPos);
}
}
- label->setVisible( i % 2 );
}
}
@@ -290,6 +288,16 @@ QString TimeAxis::textForValue(double value)
return QString::number(nr);
}
+void TimeAxis::updateTicks()
+{
+ DiveCartesianAxis::updateTicks();
+ if (maximum() > 600){
+ for(int i = 0; i < labels.count(); i++){
+ labels[i]->setVisible(i % 2);
+ }
+ }
+}
+
QString TemperatureAxis::textForValue(double value)
{
return QString::number(mkelvin_to_C( (int) value));
diff --git a/qt-ui/profile/divecartesianaxis.h b/qt-ui/profile/divecartesianaxis.h
index e4366eaf4..3f18fe8ff 100644
--- a/qt-ui/profile/divecartesianaxis.h
+++ b/qt-ui/profile/divecartesianaxis.h
@@ -36,7 +36,7 @@ public:
void animateChangeLine(const QLineF& newLine);
int unitSystem;
public slots:
- void updateTicks();
+ virtual void updateTicks();
signals:
void sizeChanged();
void maxChanged();
@@ -66,6 +66,9 @@ private slots:
};
class TimeAxis : public DiveCartesianAxis {
+ Q_OBJECT
+public:
+ virtual void updateTicks();
protected:
QString textForValue(double value);
QColor colorForValue(double value);