mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4256 Update fonts in Project and views when changing preferences
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
|
||||
#include "RimAnnotationCollection.h"
|
||||
#include "RimAnnotationGroupCollection.h"
|
||||
#include "RimAnnotationTextAppearance.h"
|
||||
#include "RimCase.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimGridView.h"
|
||||
@@ -234,6 +235,46 @@ size_t RimAnnotationInViewCollection::annotationsCount() const
|
||||
return m_textAnnotations->m_annotations.size() + allGlobalPdmAnnotations().size();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimAnnotationInViewCollection::hasTextAnnotationsWithCustomFontSize(RiaFontCache::FontSize defaultFontSize) const
|
||||
{
|
||||
for (auto annotation : textAnnotations())
|
||||
{
|
||||
if (annotation->appearance()->fontSize() != defaultFontSize)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
for (auto annotationInView : globalTextAnnotations())
|
||||
{
|
||||
if (annotationInView->sourceAnnotation()->appearance()->fontSize() != defaultFontSize)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimAnnotationInViewCollection::applyFontSizeToAllTextAnnotations(RiaFontCache::FontSize fontSize)
|
||||
{
|
||||
for (auto annotation : textAnnotations())
|
||||
{
|
||||
annotation->appearance()->setFontSize(fontSize);
|
||||
}
|
||||
|
||||
for (auto annotationInView : globalTextAnnotations())
|
||||
{
|
||||
annotationInView->sourceAnnotation()->appearance()->setFontSize(fontSize);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user