mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
First round of caf::FontTools
This commit is contained in:
@@ -1393,7 +1393,8 @@ void RiaGuiApplication::onProgramExit()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaGuiApplication::applyGuiPreferences( const RiaPreferences* oldPreferences )
|
||||
void RiaGuiApplication::applyGuiPreferences( const RiaPreferences* oldPreferences,
|
||||
const std::vector<caf::FontHolderInterface*>& defaultFontObjects )
|
||||
{
|
||||
if ( m_activeReservoirView && m_activeReservoirView->viewer() )
|
||||
{
|
||||
@@ -1418,7 +1419,10 @@ void RiaGuiApplication::applyGuiPreferences( const RiaPreferences* oldPreference
|
||||
m_preferences->appendClassNameToUiText() );
|
||||
}
|
||||
|
||||
std::map<RiaDefines::FontSettingType, RiaFontCache::FontSize> fontSizes = m_preferences->defaultFontSizes();
|
||||
for ( auto fontObject : defaultFontObjects )
|
||||
{
|
||||
fontObject->updateFonts();
|
||||
}
|
||||
|
||||
if ( this->project() )
|
||||
{
|
||||
@@ -1457,13 +1461,6 @@ void RiaGuiApplication::applyGuiPreferences( const RiaPreferences* oldPreference
|
||||
existingViewsWithCustomZScale = true;
|
||||
}
|
||||
|
||||
RimGridView* gridView = dynamic_cast<RimGridView*>( rim3dView );
|
||||
if ( gridView && gridView->annotationCollection() )
|
||||
{
|
||||
RiaFontCache::FontSize oldFontSize = oldPreferences->defaultAnnotationFontSize();
|
||||
existingObjectsWithCustomFonts =
|
||||
gridView->annotationCollection()->hasTextAnnotationsWithCustomFontSize( oldFontSize );
|
||||
}
|
||||
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>( rim3dView );
|
||||
if ( eclipseView )
|
||||
{
|
||||
@@ -1475,18 +1472,6 @@ void RiaGuiApplication::applyGuiPreferences( const RiaPreferences* oldPreference
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for ( auto fontTypeSizePair : fontSizes )
|
||||
{
|
||||
RiaFontCache::FontSize oldFontSize = oldPreferences->defaultFontSizes()[fontTypeSizePair.first];
|
||||
if ( oldFontSize != fontTypeSizePair.second )
|
||||
{
|
||||
if ( viewWindow->hasCustomFontSizes( fontTypeSizePair.first, oldFontSize ) )
|
||||
{
|
||||
existingObjectsWithCustomFonts = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( oldPreferences->defaultWellLabelColor() != wellPathCollection->wellPathLabelColor() )
|
||||
@@ -1525,16 +1510,6 @@ void RiaGuiApplication::applyGuiPreferences( const RiaPreferences* oldPreference
|
||||
|
||||
for ( auto viewWindow : allViewWindows )
|
||||
{
|
||||
for ( auto fontTypeSizePair : fontSizes )
|
||||
{
|
||||
RiaFontCache::FontSize oldFontSize = oldPreferences->defaultFontSizes()[fontTypeSizePair.first];
|
||||
int newFontSize = fontTypeSizePair.second;
|
||||
if ( oldFontSize != newFontSize )
|
||||
{
|
||||
viewWindow->applyFontSize( fontTypeSizePair.first, oldFontSize, newFontSize, applySettingsToAllViews );
|
||||
}
|
||||
}
|
||||
|
||||
auto rim3dView = dynamic_cast<Rim3dView*>( viewWindow );
|
||||
if ( rim3dView )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user