summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/divecartesianaxis.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2014-07-29 16:34:57 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-07-29 13:06:19 -0700
commit078332bae1263ebc9419ab7a818e1d727406beab (patch)
tree9869ac44e057f82f64201a77883fd3a8c6b2ac8d /qt-ui/profile/divecartesianaxis.cpp
parent936f057ddc963d9ea0e60c94c261275deca85458 (diff)
downloadsubsurface-078332bae1263ebc9419ab7a818e1d727406beab.tar.gz
Change the Ruler text values when metric system changes.
"ups", as I did this in Metric system I forgot to update to imperial when the user selected it. Fixes #665 Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> 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, 11 insertions, 18 deletions
diff --git a/qt-ui/profile/divecartesianaxis.cpp b/qt-ui/profile/divecartesianaxis.cpp
index f5123ae9e..be3e313f0 100644
--- a/qt-ui/profile/divecartesianaxis.cpp
+++ b/qt-ui/profile/divecartesianaxis.cpp
@@ -308,9 +308,9 @@ qreal DiveCartesianAxis::posAtValue(qreal value)
double retValue = realSize * percent;
double adjusted =
orientation == LeftToRight ? retValue + m.x1() + p.x() :
- orientation == RightToLeft ? retValue + m.x1() + p.x() :
- orientation == TopToBottom ? retValue + m.y1() + p.y() :
- /* entation == BottomToTop */ retValue + m.y1() + p.y();
+ orientation == RightToLeft ? retValue + m.x1() + p.x() :
+ orientation == TopToBottom ? retValue + m.y1() + p.y() :
+ /* entation == BottomToTop */ retValue + m.y1() + p.y();
return adjusted;
}
@@ -365,28 +365,21 @@ static bool isPPGraphEnabled()
return prefs.pp_graphs.po2 || prefs.pp_graphs.pn2 || prefs.pp_graphs.phe;
}
-DepthAxis::DepthAxis() : showWithPPGraph(false)
+DepthAxis::DepthAxis()
{
connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), this, SLOT(settingsChanged()));
-
- // force the correct size of the line.
- showWithPPGraph = !isPPGraphEnabled();
+ changed = true;
settingsChanged();
}
void DepthAxis::settingsChanged()
{
- // bool ppGraph = isPPGraphEnabled();
- // if ( ppGraph == showWithPPGraph){
- // return;
- // }
- //
- // if (ppGraph) {
- // animateChangeLine(shrinkedLine);
- // } else {
- // animateChangeLine(expandedLine);
- // }
- // showWithPPGraph = ppGraph;
+ static int unitSystem = prefs.units.length;
+ if ( unitSystem == prefs.units.length )
+ return;
+ changed = true;
+ updateTicks();
+ unitSystem = prefs.units.length;
}
QColor TimeAxis::colorForValue(double value)