aboutsummaryrefslogtreecommitdiffstats
path: root/profile-widget
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2016-01-25 18:15:06 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-01-25 13:04:39 -0800
commit411f455291a547c782588ec8327ec5f8a34f243c (patch)
tree3622cbd2cc533bc4071144877f16de2b51277b3d /profile-widget
parent74333963330cc5f9d8a848487522e34a822c46de (diff)
downloadsubsurface-411f455291a547c782588ec8327ec5f8a34f243c.tar.gz
Fix bug on the visibility of the Ruler Graph
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'profile-widget')
-rw-r--r--profile-widget/ruleritem.cpp10
-rw-r--r--profile-widget/ruleritem.h2
2 files changed, 5 insertions, 7 deletions
diff --git a/profile-widget/ruleritem.cpp b/profile-widget/ruleritem.cpp
index 1b9c0e929..ce217b918 100644
--- a/profile-widget/ruleritem.cpp
+++ b/profile-widget/ruleritem.cpp
@@ -4,6 +4,7 @@
#endif
#include "profilewidget2.h"
#include "display.h"
+#include "subsurface-core/subsurface-qt/SettingsObjectWrapper.h"
#include <qgraphicssceneevent.h>
@@ -81,20 +82,17 @@ RulerItem2::RulerItem2() : source(new RulerNodeItem2()),
textItemBack->setFlag(QGraphicsItem::ItemIgnoresTransformations);
setPen(QPen(QColor(Qt::black), 0.0));
#ifndef SUBSURFACE_MOBILE
- connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), this, SLOT(settingsChanged()));
+ connect(SettingsObjectWrapper::instance()->techDetails, &TechnicalDetailsSettings::rulerGraphChanged, this, &RulerItem2::settingsChanged);
#endif
}
-void RulerItem2::settingsChanged()
+void RulerItem2::settingsChanged(bool value)
{
ProfileWidget2 *profWidget = NULL;
if (scene() && scene()->views().count())
profWidget = qobject_cast<ProfileWidget2 *>(scene()->views().first());
- if (profWidget && profWidget->currentState == ProfileWidget2::PROFILE)
- setVisible(prefs.rulergraph);
- else
- setVisible(false);
+ setVisible( (profWidget && profWidget->currentState == ProfileWidget2::PROFILE) ? value : false);
}
void RulerItem2::recalculate()
diff --git a/profile-widget/ruleritem.h b/profile-widget/ruleritem.h
index 4fad0451c..343a24862 100644
--- a/profile-widget/ruleritem.h
+++ b/profile-widget/ruleritem.h
@@ -44,7 +44,7 @@ public:
public
slots:
- void settingsChanged();
+ void settingsChanged(bool toggled);
private:
struct plot_info pInfo;