diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2014-02-15 22:54:41 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-02-15 17:30:25 -0800 |
commit | 44a72b805cffd64925e7bbcc44d7f4a8a675e82f (patch) | |
tree | eb299870c46c3ce53e0c2cc9828d921823468705 /qt-ui | |
parent | 4699363a9ee4d61d6fb0ea0bc10a47d8a01b79ff (diff) | |
download | subsurface-44a72b805cffd64925e7bbcc44d7f4a8a675e82f.tar.gz |
Make it possible to hide some of the grid lines.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/profile/divecartesianaxis.cpp | 16 | ||||
-rw-r--r-- | qt-ui/profile/divecartesianaxis.h | 2 | ||||
-rw-r--r-- | qt-ui/profile/profilewidget2.cpp | 10 |
3 files changed, 20 insertions, 8 deletions
diff --git a/qt-ui/profile/divecartesianaxis.cpp b/qt-ui/profile/divecartesianaxis.cpp index 705e06a1c..bb77a341d 100644 --- a/qt-ui/profile/divecartesianaxis.cpp +++ b/qt-ui/profile/divecartesianaxis.cpp @@ -101,6 +101,17 @@ void DiveCartesianAxis::setTextVisible(bool arg1) } } +void DiveCartesianAxis::setLinesVisible(bool arg1) +{ + if(lineVisibility == arg1){ + return; + } + lineVisibility = arg1; + Q_FOREACH(DiveLineItem *item, lines){ + item->setVisible(lineVisibility ); + } +} + template<typename T> void emptyList( QList<T*>& list, double steps){ if (!list.isEmpty() && list.size() > steps) { while (list.size() > steps) { @@ -223,9 +234,10 @@ void DiveCartesianAxis::updateTicks() } } - Q_FOREACH(DiveTextItem *item, labels){ + Q_FOREACH(DiveTextItem *item, labels) item->setVisible(textVisibility); - } + Q_FOREACH(DiveLineItem *item, lines) + item->setVisible(lineVisibility); } void DiveCartesianAxis::animateChangeLine(const QLineF& newLine) diff --git a/qt-ui/profile/divecartesianaxis.h b/qt-ui/profile/divecartesianaxis.h index 7db47ae9d..1bfb4b913 100644 --- a/qt-ui/profile/divecartesianaxis.h +++ b/qt-ui/profile/divecartesianaxis.h @@ -37,6 +37,7 @@ public: void setTextColor(const QColor& color); void animateChangeLine(const QLineF& newLine); void setTextVisible(bool arg1); + void setLinesVisible(bool arg1); void setLineSize(qreal lineSize); int unitSystem; public slots: @@ -57,6 +58,7 @@ protected: double tick_size; QColor textColor; bool textVisibility; + bool lineVisibility; double labelScale; qreal line_size; }; diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index ecaa3b170..06f1f6707 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -176,14 +176,12 @@ void ProfileWidget2::setupItemOnScene() CREATE_PP_GAS( po2GasItem, PO2, PO2, PO2_ALERT, "po2threshold", "po2graph"); #undef CREATE_PP_GAS -#ifdef QT_NO_DEBUG // Some debug helpers. temperatureAxis->setTextVisible(false); + temperatureAxis->setLinesVisible(false); cylinderPressureAxis->setTextVisible(false); -#else - temperatureAxis->setTextVisible(true); - cylinderPressureAxis->setTextVisible(true); -#endif - + cylinderPressureAxis->setLinesVisible(false); + timeAxis->setLinesVisible(true); + profileYAxis->setLinesVisible(true); } void ProfileWidget2::setupItemSizes() |