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:
@@ -593,6 +593,7 @@ void RimGridCrossPlot::updatePlot()
|
||||
RiuQwtPlotTools::setCommonPlotBehaviour( m_plotWidget );
|
||||
RiuQwtPlotTools::setDefaultAxes( m_plotWidget );
|
||||
|
||||
updateFonts();
|
||||
updateAxes();
|
||||
|
||||
for ( auto dataSet : m_crossPlotDataSets )
|
||||
@@ -729,65 +730,6 @@ void RimGridCrossPlot::setYAxisInverted( bool inverted )
|
||||
m_yAxisProperties->setAxisInverted( inverted );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimGridCrossPlot::hasCustomFontSizes( RiaDefines::FontSettingType fontSettingType, int defaultFontSize ) const
|
||||
{
|
||||
if ( fontSettingType != RiaDefines::FontSettingType::PLOT_FONT ) return false;
|
||||
|
||||
for ( auto plotAxis : allPlotAxes() )
|
||||
{
|
||||
if ( plotAxis->titleFontSize() != defaultFontSize || plotAxis->valuesFontSize() != defaultFontSize )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if ( legendFontSize() != defaultFontSize )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimGridCrossPlot::applyFontSize( RiaDefines::FontSettingType fontSettingType,
|
||||
int oldFontSize,
|
||||
int fontSize,
|
||||
bool forceChange /*= false*/ )
|
||||
{
|
||||
bool anyChange = false;
|
||||
if ( fontSettingType == RiaDefines::FontSettingType::PLOT_FONT && m_plotWidget )
|
||||
{
|
||||
for ( auto plotAxis : allPlotAxes() )
|
||||
{
|
||||
if ( forceChange || plotAxis->titleFontSize() == oldFontSize )
|
||||
{
|
||||
plotAxis->setTitleFontSize( fontSize );
|
||||
anyChange = true;
|
||||
}
|
||||
if ( forceChange || plotAxis->valuesFontSize() == oldFontSize )
|
||||
{
|
||||
plotAxis->setValuesFontSize( fontSize );
|
||||
anyChange = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ( forceChange || legendFontSize() == oldFontSize )
|
||||
{
|
||||
setLegendFontSize( fontSize );
|
||||
|
||||
anyChange = true;
|
||||
}
|
||||
|
||||
if ( anyChange ) loadDataAndUpdate();
|
||||
}
|
||||
return anyChange;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -913,8 +855,8 @@ void RimGridCrossPlot::updateAxisInQwt( RiaDefines::PlotAxis axisType )
|
||||
alignment = Qt::AlignRight;
|
||||
}
|
||||
m_plotWidget->setAxisFontsAndAlignment( qwtAxisId,
|
||||
axisProperties->titleFontSize(),
|
||||
axisProperties->valuesFontSize(),
|
||||
caf::FontTools::pointSizeToPixelSize( axisProperties->titleFontSize() ),
|
||||
caf::FontTools::pointSizeToPixelSize( axisProperties->valuesFontSize() ),
|
||||
true,
|
||||
alignment );
|
||||
m_plotWidget->setAxisTitleText( qwtAxisId, axisParameterString );
|
||||
|
||||
@@ -96,12 +96,6 @@ public:
|
||||
bool isYAxisLogarithmic() const;
|
||||
void setYAxisInverted( bool inverted );
|
||||
|
||||
bool hasCustomFontSizes( RiaDefines::FontSettingType fontSettingType, int defaultFontSize ) const override;
|
||||
bool applyFontSize( RiaDefines::FontSettingType fontSettingType,
|
||||
int oldFontSize,
|
||||
int fontSize,
|
||||
bool forceChange = false ) override;
|
||||
|
||||
void updateLegend() override;
|
||||
|
||||
void updateZoomInQwt() override;
|
||||
|
||||
Reference in New Issue
Block a user