mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#51 Add preference option to control legend background
This commit is contained in:
parent
b4935a0534
commit
4d7f753d3c
@ -77,6 +77,8 @@ RiaPreferences::RiaPreferences(void)
|
|||||||
CAF_PDM_InitField(&includeFractureDebugInfoFile, "includeFractureDebugInfoFile", false, "Include Fracture Debug Info for Completion Export", "", "", "");
|
CAF_PDM_InitField(&includeFractureDebugInfoFile, "includeFractureDebugInfoFile", false, "Include Fracture Debug Info for Completion Export", "", "", "");
|
||||||
includeFractureDebugInfoFile.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
|
includeFractureDebugInfoFile.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
|
||||||
|
|
||||||
|
CAF_PDM_InitField(&showLegendBackground, "showLegendBackground", true, "Enable Legend Background", "", "", "");
|
||||||
|
|
||||||
CAF_PDM_InitFieldNoDefault(&lastUsedProjectFileName,"lastUsedProjectFileName", "Last Used Project File", "", "", "");
|
CAF_PDM_InitFieldNoDefault(&lastUsedProjectFileName,"lastUsedProjectFileName", "Last Used Project File", "", "", "");
|
||||||
lastUsedProjectFileName.uiCapability()->setUiHidden(true);
|
lastUsedProjectFileName.uiCapability()->setUiHidden(true);
|
||||||
|
|
||||||
@ -153,6 +155,7 @@ void RiaPreferences::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
|
|||||||
defaultSettingsGroup->add(&defaultWellLabelColor);
|
defaultSettingsGroup->add(&defaultWellLabelColor);
|
||||||
defaultSettingsGroup->add(&fontSizeInScene);
|
defaultSettingsGroup->add(&fontSizeInScene);
|
||||||
defaultSettingsGroup->add(&defaultScaleFactorZ);
|
defaultSettingsGroup->add(&defaultScaleFactorZ);
|
||||||
|
defaultSettingsGroup->add(&showLegendBackground);
|
||||||
|
|
||||||
caf::PdmUiGroup* viewsGroup = uiOrdering.addNewGroup("3D Views");
|
caf::PdmUiGroup* viewsGroup = uiOrdering.addNewGroup("3D Views");
|
||||||
viewsGroup->add(&navigationPolicy);
|
viewsGroup->add(&navigationPolicy);
|
||||||
|
@ -63,6 +63,7 @@ public: // Pdm Fields
|
|||||||
caf::PdmField<cvf::Color3f> defaultWellLabelColor;
|
caf::PdmField<cvf::Color3f> defaultWellLabelColor;
|
||||||
caf::PdmField<bool> showLasCurveWithoutTvdWarning;
|
caf::PdmField<bool> showLasCurveWithoutTvdWarning;
|
||||||
caf::PdmField<QString> fontSizeInScene;
|
caf::PdmField<QString> fontSizeInScene;
|
||||||
|
caf::PdmField<bool> showLegendBackground;
|
||||||
|
|
||||||
caf::PdmField<bool> useShaders;
|
caf::PdmField<bool> useShaders;
|
||||||
caf::PdmField<bool> showHud;
|
caf::PdmField<bool> showHud;
|
||||||
|
@ -48,6 +48,7 @@
|
|||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include "RimIntersectionCollection.h"
|
#include "RimIntersectionCollection.h"
|
||||||
|
#include "RiaPreferences.h"
|
||||||
|
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT(RimLegendConfig, "Legend");
|
CAF_PDM_SOURCE_INIT(RimLegendConfig, "Legend");
|
||||||
@ -369,6 +370,10 @@ void RimLegendConfig::updateLegend()
|
|||||||
}
|
}
|
||||||
m_scalarMapperLegend->setTickPrecision(cvf::Math::clamp(numDecimalDigits, 0, 20));
|
m_scalarMapperLegend->setTickPrecision(cvf::Math::clamp(numDecimalDigits, 0, 20));
|
||||||
|
|
||||||
|
RiaApplication* app = RiaApplication::instance();
|
||||||
|
RiaPreferences* preferences = app->preferences();
|
||||||
|
m_scalarMapperLegend->enableBackground(preferences->showLegendBackground());
|
||||||
|
m_categoryLegend->enableBackground(preferences->showLegendBackground());
|
||||||
|
|
||||||
if (m_globalAutoMax != cvf::UNDEFINED_DOUBLE )
|
if (m_globalAutoMax != cvf::UNDEFINED_DOUBLE )
|
||||||
{
|
{
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
#include "cvfqtUtils.h"
|
#include "cvfqtUtils.h"
|
||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
#include "RiaPreferences.h"
|
||||||
|
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT(RimTernaryLegendConfig, "RimTernaryLegendConfig");
|
CAF_PDM_SOURCE_INIT(RimTernaryLegendConfig, "RimTernaryLegendConfig");
|
||||||
@ -201,6 +202,10 @@ void RimTernaryLegendConfig::updateLegend()
|
|||||||
if (!m_legend.isNull())
|
if (!m_legend.isNull())
|
||||||
{
|
{
|
||||||
m_legend->setRangeText(soilRange, sgasRange, swatRange);
|
m_legend->setRangeText(soilRange, sgasRange, swatRange);
|
||||||
|
|
||||||
|
RiaApplication* app = RiaApplication::instance();
|
||||||
|
RiaPreferences* preferences = app->preferences();
|
||||||
|
m_legend->enableBackground(preferences->showLegendBackground());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user