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:
@@ -23,6 +23,7 @@
|
||||
#include "RiaExtractionTools.h"
|
||||
#include "RiaGuiApplication.h"
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaPreferences.h"
|
||||
#include "RiaSimWellBranchTools.h"
|
||||
|
||||
#include "RigEclipseCaseData.h"
|
||||
@@ -197,6 +198,8 @@ RimWellLogTrack::RimWellLogTrack()
|
||||
m_majorTickInterval.uiCapability()->setUiHidden( true );
|
||||
m_minorTickInterval.uiCapability()->setUiHidden( true );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_axisFontSize, "AxisFontSize", "Axis Font Size", "", "", "" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_regionAnnotationType, "AnnotationType", "Region Annotations", "", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_regionAnnotationDisplay, "RegionDisplay", "Region Display", "", "", "" );
|
||||
|
||||
@@ -497,6 +500,14 @@ void RimWellLogTrack::updateYZoom()
|
||||
m_plotWidget->setAxisRange( QwtPlot::yLeft, m_visibleDepthRangeMin(), m_visibleDepthRangeMax() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int RimWellLogTrack::axisFontSize() const
|
||||
{
|
||||
return caf::FontTools::absolutePointSize(RiaPreferences::current()->defaultPlotFontSize(), m_axisFontSize());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -881,38 +892,6 @@ QString RimWellLogTrack::asciiDataForPlotExport() const
|
||||
return out;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimWellLogTrack::hasCustomFontSizes( RiaDefines::FontSettingType fontSettingType, int defaultFontSize ) const
|
||||
{
|
||||
if ( fontSettingType == RiaDefines::FontSettingType::PLOT_FONT && m_plotWidget )
|
||||
{
|
||||
return defaultFontSize != m_plotWidget->axisTitleFontSize( QwtPlot::xTop );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimWellLogTrack::applyFontSize( RiaDefines::FontSettingType fontSettingType,
|
||||
int oldFontSize,
|
||||
int fontSize,
|
||||
bool forceChange /*= false*/ )
|
||||
{
|
||||
if ( fontSettingType == RiaDefines::FontSettingType::PLOT_FONT && m_plotWidget )
|
||||
{
|
||||
if ( oldFontSize == m_plotWidget->axisTitleFontSize( QwtPlot::xTop ) || forceChange )
|
||||
{
|
||||
m_plotWidget->setAxisFontsAndAlignment( QwtPlot::xTop, fontSize, fontSize );
|
||||
m_plotWidget->setAxisFontsAndAlignment( QwtPlot::yLeft, fontSize, fontSize );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -2765,6 +2744,7 @@ void RimWellLogTrack::removeRegionAnnotations()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogTrack::doUpdateLayout()
|
||||
{
|
||||
updateFonts();
|
||||
m_plotWidget->scheduleReplot();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user