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:
@@ -48,6 +48,9 @@ RimAbstractCorrelationPlot::RimAbstractCorrelationPlot()
|
||||
CAF_PDM_InitField( &m_showPlotTitle, "ShowPlotTitle", true, "Show Plot Title", "", "", "" );
|
||||
CAF_PDM_InitField( &m_useAutoPlotTitle, "AutoTitle", true, "Automatic Plot Title", "", "", "" );
|
||||
CAF_PDM_InitField( &m_description, "PlotTitle", QString( "Correlation Plot" ), "Custom Plot Title", "", "", "" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_labelFontSize, "LabelFontSize", "Label Font Size", "", "", "" );
|
||||
m_labelFontSize = caf::FontTools::RelativeSize::XSmall;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -311,19 +314,6 @@ QImage RimAbstractCorrelationPlot::snapshotWindowContent()
|
||||
return image;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimAbstractCorrelationPlot::applyFontSize( RiaDefines::FontSettingType fontSettingType,
|
||||
int oldFontSize,
|
||||
int fontSize,
|
||||
bool forceChange /*= false */ )
|
||||
{
|
||||
bool anyChange = false;
|
||||
|
||||
return anyChange;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -72,10 +72,6 @@ protected:
|
||||
void deleteViewWidget() override;
|
||||
void zoomAll() override {}
|
||||
QImage snapshotWindowContent() override;
|
||||
bool applyFontSize( RiaDefines::FontSettingType fontSettingType,
|
||||
int oldFontSize,
|
||||
int fontSize,
|
||||
bool forceChange = false ) override;
|
||||
|
||||
// RimPlotWindow overrides
|
||||
QString description() const override;
|
||||
@@ -118,4 +114,6 @@ protected:
|
||||
caf::PdmField<bool> m_showPlotTitle;
|
||||
caf::PdmField<bool> m_useAutoPlotTitle;
|
||||
caf::PdmField<QString> m_description;
|
||||
|
||||
caf::PdmField<caf::FontTools::RelativeSizeEnum> m_labelFontSize;
|
||||
};
|
||||
|
||||
@@ -304,7 +304,7 @@ void RimCorrelationMatrixPlot::updateAxes()
|
||||
m_plotWidget->setAxisScaleEngine( QwtPlot::yLeft, new RiuQwtLinearScaleEngine );
|
||||
m_plotWidget->setAxisTitleText( QwtPlot::yLeft, "Result Vector" );
|
||||
m_plotWidget->setAxisTitleEnabled( QwtPlot::yLeft, true );
|
||||
m_plotWidget->setAxisFontsAndAlignment( QwtPlot::yLeft, 11, 7, false, Qt::AlignCenter );
|
||||
m_plotWidget->setAxisFontsAndAlignment( QwtPlot::yLeft, 10, 6, false, Qt::AlignCenter );
|
||||
m_plotWidget->setAxisLabelsAndTicksEnabled( QwtPlot::yLeft, true, false );
|
||||
m_plotWidget->setAxisRange( QwtPlot::yLeft, 0.0, (double)m_resultLabels.size() + 1 );
|
||||
m_plotWidget->setMajorAndMinorTickIntervalsAndRange( QwtPlot::yLeft,
|
||||
@@ -322,7 +322,7 @@ void RimCorrelationMatrixPlot::updateAxes()
|
||||
m_plotWidget->setAxisScaleEngine( QwtPlot::xBottom, new RiuQwtLinearScaleEngine );
|
||||
m_plotWidget->setAxisTitleText( QwtPlot::xBottom, "Ensemble Parameter" );
|
||||
m_plotWidget->setAxisTitleEnabled( QwtPlot::xBottom, true );
|
||||
m_plotWidget->setAxisFontsAndAlignment( QwtPlot::xBottom, 11, 6, false, Qt::AlignCenter | Qt::AlignTop );
|
||||
m_plotWidget->setAxisFontsAndAlignment( QwtPlot::xBottom, 10, 6, false, Qt::AlignCenter | Qt::AlignTop );
|
||||
m_plotWidget->setAxisLabelsAndTicksEnabled( QwtPlot::xBottom, true, false );
|
||||
m_plotWidget->setAxisRange( QwtPlot::xBottom, 0.0, (double)m_paramLabels.size() + 1 );
|
||||
m_plotWidget->setMajorAndMinorTickIntervalsAndRange( QwtPlot::xBottom,
|
||||
@@ -502,7 +502,7 @@ void RimCorrelationMatrixPlot::createMatrix()
|
||||
cvf::Color3f contrastColor = RiaColorTools::contrastColor( cvf::Color3f( color ) );
|
||||
textLabel.setColor( RiaColorTools::toQColor( contrastColor ) );
|
||||
QFont font = textLabel.font();
|
||||
font.setPixelSize( RiaFontCache::pointSizeToPixelSize( 7 ) );
|
||||
font.setPixelSize( caf::FontTools::pointSizeToPixelSize( 7 ) );
|
||||
textLabel.setFont( font );
|
||||
QwtPlotMarker* marker = new QwtPlotMarker();
|
||||
marker->setLabel( textLabel );
|
||||
|
||||
@@ -117,7 +117,7 @@ void RimCorrelationPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrder
|
||||
caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroup( "Summary Vector" );
|
||||
|
||||
curveDataGroup->add( &m_selectedVarsUiField );
|
||||
curveDataGroup->add( &m_pushButtonSelectSummaryAddress, { false, 1, 0 } );
|
||||
curveDataGroup->add( &m_pushButtonSelectSummaryAddress, {false, 1, 0} );
|
||||
curveDataGroup->add( &m_timeStep );
|
||||
|
||||
caf::PdmUiGroup* plotGroup = uiOrdering.addNewGroup( "Plot Settings" );
|
||||
@@ -184,11 +184,11 @@ void RimCorrelationPlot::updateAxes()
|
||||
|
||||
m_plotWidget->setAxisTitleText( QwtPlot::yLeft, "Parameter" );
|
||||
m_plotWidget->setAxisTitleEnabled( QwtPlot::yLeft, true );
|
||||
m_plotWidget->setAxisFontsAndAlignment( QwtPlot::yLeft, 11, 11, false, Qt::AlignCenter );
|
||||
m_plotWidget->setAxisFontsAndAlignment( QwtPlot::yLeft, 10, 10, false, Qt::AlignCenter );
|
||||
|
||||
m_plotWidget->setAxisTitleText( QwtPlot::xBottom, "Pearson Correlation Coefficient" );
|
||||
m_plotWidget->setAxisTitleEnabled( QwtPlot::xBottom, true );
|
||||
m_plotWidget->setAxisFontsAndAlignment( QwtPlot::xBottom, 11, 11, false, Qt::AlignCenter );
|
||||
m_plotWidget->setAxisFontsAndAlignment( QwtPlot::xBottom, 10, 10, false, Qt::AlignCenter );
|
||||
if ( m_showAbsoluteValues )
|
||||
{
|
||||
m_plotWidget->setAxisTitleText( QwtPlot::xBottom, "Pearson Correlation Coefficient ABS" );
|
||||
|
||||
@@ -173,12 +173,12 @@ void RimParameterResultCrossPlot::updateAxes()
|
||||
m_plotWidget->setAxisTitleText( QwtPlot::yLeft, m_selectedVarsUiField );
|
||||
m_plotWidget->setAxisTitleEnabled( QwtPlot::yLeft, true );
|
||||
m_plotWidget->setAxisAutoScale( QwtPlot::yLeft, true );
|
||||
m_plotWidget->setAxisFontsAndAlignment( QwtPlot::yLeft, 11, 11, false, Qt::AlignCenter );
|
||||
m_plotWidget->setAxisFontsAndAlignment( QwtPlot::yLeft, 10, 10, false, Qt::AlignCenter );
|
||||
|
||||
m_plotWidget->setAxisTitleText( QwtPlot::xBottom, m_ensembleParameter );
|
||||
m_plotWidget->setAxisTitleEnabled( QwtPlot::xBottom, true );
|
||||
m_plotWidget->setAxisAutoScale( QwtPlot::xBottom, true );
|
||||
m_plotWidget->setAxisFontsAndAlignment( QwtPlot::xBottom, 11, 11, false, Qt::AlignCenter );
|
||||
m_plotWidget->setAxisFontsAndAlignment( QwtPlot::xBottom, 10, 10, false, Qt::AlignCenter );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user