mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4407 Make sure we convert fontInScene from point size to enum value from old registry settings
This commit is contained in:
@@ -1299,7 +1299,7 @@ void RiaApplication::initialize()
|
||||
{
|
||||
m_preferences = new RiaPreferences;
|
||||
caf::PdmSettings::readFieldsFromApplicationStore(m_preferences);
|
||||
|
||||
m_preferences->initAfterReadRecursively();
|
||||
applyPreferences(nullptr);
|
||||
|
||||
// Start with a project
|
||||
|
||||
@@ -45,7 +45,8 @@ public:
|
||||
FONT_SIZE_14,
|
||||
FONT_SIZE_16,
|
||||
FONT_SIZE_24,
|
||||
FONT_SIZE_32
|
||||
FONT_SIZE_32,
|
||||
MAX_FONT_SIZE = FONT_SIZE_32
|
||||
};
|
||||
|
||||
typedef caf::AppEnum<FontSize> FontSizeType;
|
||||
|
||||
@@ -289,6 +289,19 @@ QList<caf::PdmOptionItemInfo> RiaPreferences::calculateValueOptions(const caf::P
|
||||
return options;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaPreferences::initAfterRead()
|
||||
{
|
||||
// If the stored font size is larger than the maximum enum value, the stored font size is actually point size
|
||||
int defaultSceneFontEnumValue = static_cast<int>(defaultSceneFontSize.v());
|
||||
if (defaultSceneFontEnumValue > (int) RiaFontCache::MAX_FONT_SIZE)
|
||||
{
|
||||
defaultSceneFontSize = RiaFontCache::fontSizeEnumFromPointSize(defaultSceneFontEnumValue);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -110,6 +110,7 @@ protected:
|
||||
void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute) override;
|
||||
void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override;
|
||||
void initAfterRead() override;
|
||||
|
||||
private:
|
||||
caf::PdmChildField<RifReaderSettings*> m_readerSettings;
|
||||
|
||||
@@ -63,6 +63,7 @@ void RicEditPreferencesFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
// Read back currently stored values using QSettings
|
||||
caf::PdmSettings::readFieldsFromApplicationStore(app->preferences());
|
||||
app->preferences()->initAfterReadRecursively();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user