mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4255 Read default plot font sizes from preferences and apply
This commit is contained in:
@@ -18,8 +18,6 @@
|
||||
|
||||
#include "RimAnnotationInViewCollection.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RimAnnotationCollection.h"
|
||||
#include "RimAnnotationGroupCollection.h"
|
||||
#include "RimAnnotationTextAppearance.h"
|
||||
@@ -262,17 +260,31 @@ bool RimAnnotationInViewCollection::hasTextAnnotationsWithCustomFontSize(RiaFont
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimAnnotationInViewCollection::applyFontSizeToAllTextAnnotations(RiaFontCache::FontSize fontSize)
|
||||
bool RimAnnotationInViewCollection::applyFontSizeToAllTextAnnotations(RiaFontCache::FontSize oldFontSize,
|
||||
RiaFontCache::FontSize fontSize,
|
||||
bool forceChange)
|
||||
{
|
||||
bool anyChange = false;
|
||||
for (auto annotation : textAnnotations())
|
||||
{
|
||||
annotation->appearance()->setFontSize(fontSize);
|
||||
if (forceChange || annotation->appearance()->fontSize() == oldFontSize)
|
||||
{
|
||||
annotation->appearance()->setFontSize(fontSize);
|
||||
annotation->updateConnectedEditors();
|
||||
anyChange = true;
|
||||
}
|
||||
}
|
||||
|
||||
for (auto annotationInView : globalTextAnnotations())
|
||||
{
|
||||
annotationInView->sourceAnnotation()->appearance()->setFontSize(fontSize);
|
||||
if (forceChange || annotationInView->sourceAnnotation()->appearance()->fontSize() == oldFontSize)
|
||||
{
|
||||
annotationInView->sourceAnnotation()->appearance()->setFontSize(fontSize);
|
||||
annotationInView->updateConnectedEditors();
|
||||
anyChange = true;
|
||||
}
|
||||
}
|
||||
return anyChange;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
size_t annotationsCount() const;
|
||||
|
||||
bool hasTextAnnotationsWithCustomFontSize(RiaFontCache::FontSize defaultFontSize) const;
|
||||
void applyFontSizeToAllTextAnnotations(RiaFontCache::FontSize fontSize);
|
||||
bool applyFontSizeToAllTextAnnotations(RiaFontCache::FontSize oldFontSize, RiaFontCache::FontSize fontSize, bool forceSizeChange = false);
|
||||
|
||||
protected:
|
||||
void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
|
||||
Reference in New Issue
Block a user