1
0
Fork 0
mirror of https://github.com/subsurface/subsurface.git synced 2025-02-19 22:16:15 +00:00

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>
This commit is contained in:
Tomaz Canabrava 2016-01-25 18:15:06 -02:00 committed by Dirk Hohndel
parent 7433396333
commit 411f455291
4 changed files with 7 additions and 8 deletions
profile-widget
subsurface-core

View file

@ -4,6 +4,7 @@
#endif #endif
#include "profilewidget2.h" #include "profilewidget2.h"
#include "display.h" #include "display.h"
#include "subsurface-core/subsurface-qt/SettingsObjectWrapper.h"
#include <qgraphicssceneevent.h> #include <qgraphicssceneevent.h>
@ -81,20 +82,17 @@ RulerItem2::RulerItem2() : source(new RulerNodeItem2()),
textItemBack->setFlag(QGraphicsItem::ItemIgnoresTransformations); textItemBack->setFlag(QGraphicsItem::ItemIgnoresTransformations);
setPen(QPen(QColor(Qt::black), 0.0)); setPen(QPen(QColor(Qt::black), 0.0));
#ifndef SUBSURFACE_MOBILE #ifndef SUBSURFACE_MOBILE
connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), this, SLOT(settingsChanged())); connect(SettingsObjectWrapper::instance()->techDetails, &TechnicalDetailsSettings::rulerGraphChanged, this, &RulerItem2::settingsChanged);
#endif #endif
} }
void RulerItem2::settingsChanged() void RulerItem2::settingsChanged(bool value)
{ {
ProfileWidget2 *profWidget = NULL; ProfileWidget2 *profWidget = NULL;
if (scene() && scene()->views().count()) if (scene() && scene()->views().count())
profWidget = qobject_cast<ProfileWidget2 *>(scene()->views().first()); profWidget = qobject_cast<ProfileWidget2 *>(scene()->views().first());
if (profWidget && profWidget->currentState == ProfileWidget2::PROFILE) setVisible( (profWidget && profWidget->currentState == ProfileWidget2::PROFILE) ? value : false);
setVisible(prefs.rulergraph);
else
setVisible(false);
} }
void RulerItem2::recalculate() void RulerItem2::recalculate()

View file

@ -44,7 +44,7 @@ public:
public public
slots: slots:
void settingsChanged(); void settingsChanged(bool toggled);
private: private:
struct plot_info pInfo; struct plot_info pInfo;

View file

@ -1310,6 +1310,7 @@ void loadPreferences()
GET_BOOL("calcalltissues", calcalltissues); GET_BOOL("calcalltissues", calcalltissues);
GET_BOOL("hrgraph", hrgraph); GET_BOOL("hrgraph", hrgraph);
GET_BOOL("tankbar", tankbar); GET_BOOL("tankbar", tankbar);
GET_BOOL("RulerBar", rulergraph);
GET_BOOL("percentagegraph", percentagegraph); GET_BOOL("percentagegraph", percentagegraph);
GET_INT("gflow", gflow); GET_INT("gflow", gflow);
GET_INT("gfhigh", gfhigh); GET_INT("gfhigh", gfhigh);

View file

@ -363,7 +363,7 @@ void TechnicalDetailsSettings::setRulerGraph(bool value)
QSettings s; QSettings s;
s.beginGroup(tecDetails); s.beginGroup(tecDetails);
s.setValue("RulerBar", value); s.setValue("RulerBar", value);
prefs.pp_graphs.phe_threshold = value; prefs.rulergraph = value;
emit rulerGraphChanged(value); emit rulerGraphChanged(value);
} }