mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Fix DepthAxis when partial pressures aren't used.
Set showWithPPGraph so that animateChangeLine() is always called the first time settingsChanged() is called. Signed-off-by: Michael Andreen <harv@ruin.nu> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
3217201bb7
commit
ddd7d2edcc
1 changed files with 16 additions and 8 deletions
|
@ -259,18 +259,26 @@ QColor DepthAxis::colorForValue(double value)
|
|||
return QColor(Qt::red);
|
||||
}
|
||||
|
||||
DepthAxis::DepthAxis() : showWithPPGraph(false)
|
||||
{
|
||||
connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), this, SLOT(settingsChanged()));
|
||||
settingsChanged(); // force the correct size of the line.
|
||||
}
|
||||
|
||||
void DepthAxis::settingsChanged()
|
||||
static bool isPPGraphEnabled()
|
||||
{
|
||||
QSettings s;
|
||||
|
||||
s.beginGroup("TecDetails");
|
||||
bool ppGraph = s.value("phegraph").toBool() || s.value("po2graph").toBool() || s.value("pn2graph").toBool();
|
||||
return s.value("phegraph").toBool() || s.value("po2graph").toBool() || s.value("pn2graph").toBool();
|
||||
}
|
||||
|
||||
DepthAxis::DepthAxis() : showWithPPGraph(false)
|
||||
{
|
||||
connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), this, SLOT(settingsChanged()));
|
||||
|
||||
// force the correct size of the line.
|
||||
showWithPPGraph = !isPPGraphEnabled();
|
||||
settingsChanged();
|
||||
}
|
||||
|
||||
void DepthAxis::settingsChanged()
|
||||
{
|
||||
bool ppGraph = isPPGraphEnabled();
|
||||
if ( ppGraph == showWithPPGraph){
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue