mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Improved font handling
This commit is contained in:
@@ -290,13 +290,15 @@ QString RimGridCrossPlotDataSet::createAutoName() const
|
||||
nameTags += timeStepString();
|
||||
}
|
||||
|
||||
QString fullTitle = nameTags.join( ", " );
|
||||
|
||||
if ( m_nameConfig->addGrouping() && groupParameter() != "None" )
|
||||
{
|
||||
QString catTitle = groupTitle();
|
||||
if ( !catTitle.isEmpty() ) nameTags += catTitle;
|
||||
if ( !catTitle.isEmpty() ) fullTitle += QString( " [%1]" ).arg( catTitle );
|
||||
}
|
||||
|
||||
return nameTags.join( ", " );
|
||||
return fullTitle;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -306,7 +308,7 @@ QString RimGridCrossPlotDataSet::groupTitle() const
|
||||
{
|
||||
if ( m_grouping != NO_GROUPING )
|
||||
{
|
||||
return QString( "Grouped by %1" ).arg( groupParameter() );
|
||||
return QString( "[%1]" ).arg( groupParameter() );
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -89,9 +89,9 @@ RimPlotAxisProperties::RimPlotAxisProperties()
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_titlePositionEnum, "TitlePosition", "Title Position", "", "", "");
|
||||
CAF_PDM_InitField(&m_titleFontSize, "FontSize", 10, "Font Size", "", "", "");
|
||||
m_titleFontSize = RiaFontCache::pointSizeFromFontSizeEnum(RiaApplication::instance()->preferences()->defaultPlotFontSize());
|
||||
m_titleFontSize = RiaApplication::instance()->preferences()->defaultPlotFontSize();
|
||||
CAF_PDM_InitField(&m_valuesFontSize, "ValuesFontSize", 10, "Font Size", "", "", "");
|
||||
m_valuesFontSize = RiaFontCache::pointSizeFromFontSizeEnum(RiaApplication::instance()->preferences()->defaultPlotFontSize());
|
||||
m_valuesFontSize = RiaApplication::instance()->preferences()->defaultPlotFontSize();
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_annotations, "Annotations", "", "", "", "");
|
||||
|
||||
|
||||
@@ -47,8 +47,7 @@ RimPlotWindow::RimPlotWindow()
|
||||
CAF_PDM_InitField( &m_showPlotLegends, "ShowTrackLegends", true, "Show Legends", "", "", "" );
|
||||
CAF_PDM_InitField( &m_plotLegendsHorizontal, "TrackLegendsHorizontal", true, "Legend Orientation", "", "", "" );
|
||||
m_plotLegendsHorizontal.uiCapability()->setUiEditorTypeName( caf::PdmUiComboBoxEditor::uiEditorTypeName() );
|
||||
int defaultFontSize = RiaFontCache::pointSizeFromFontSizeEnum(
|
||||
RiaApplication::instance()->preferences()->defaultPlotFontSize() );
|
||||
int defaultFontSize = RiaApplication::instance()->preferences()->defaultPlotFontSize();
|
||||
CAF_PDM_InitField( &m_legendFontSize,
|
||||
"LegendFontSize",
|
||||
std::max( 8, defaultFontSize - 2 ),
|
||||
|
||||
@@ -117,24 +117,17 @@ void RimSummaryPlotAxisFormatter::applyAxisPropertiesToPlot( RiuSummaryQwtPlot*
|
||||
|
||||
QwtText axisTitleY = qwtPlot->axisTitle( m_axisProperties->qwtPlotAxisType() );
|
||||
|
||||
QFont axisTitleYFont = axisTitleY.font();
|
||||
axisTitleYFont.setBold( true );
|
||||
axisTitleYFont.setPointSize( m_axisProperties->titleFontSize() );
|
||||
axisTitleY.setFont( axisTitleYFont );
|
||||
|
||||
axisTitleY.setText( axisTitle );
|
||||
|
||||
Qt::AlignmentFlag titleAlignment = Qt::AlignCenter;
|
||||
if ( m_axisProperties->titlePosition() == RimPlotAxisPropertiesInterface::AXIS_TITLE_END )
|
||||
{
|
||||
titleAlignment = Qt::AlignRight;
|
||||
}
|
||||
qwtPlot->setAxisTitleText( m_axisProperties->qwtPlotAxisType(), axisTitle );
|
||||
qwtPlot->setAxisFontsAndAlignment( m_axisProperties->qwtPlotAxisType(),
|
||||
m_axisProperties->titleFontSize(),
|
||||
m_axisProperties->valuesFontSize(),
|
||||
true,
|
||||
titleAlignment );
|
||||
qwtPlot->setAxisTitleText( m_axisProperties->qwtPlotAxisType(), axisTitle );
|
||||
qwtPlot->setAxisTitleEnabled( m_axisProperties->qwtPlotAxisType(), true );
|
||||
}
|
||||
|
||||
|
||||
@@ -99,11 +99,9 @@ RimSummaryTimeAxisProperties::RimSummaryTimeAxisProperties()
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_titlePositionEnum, "TitlePosition", "Title Position", "", "", "" );
|
||||
CAF_PDM_InitField( &m_titleFontSize, "FontSize", 10, "Font Size", "", "", "" );
|
||||
m_titleFontSize = RiaFontCache::pointSizeFromFontSizeEnum(
|
||||
RiaApplication::instance()->preferences()->defaultPlotFontSize() );
|
||||
m_titleFontSize = RiaApplication::instance()->preferences()->defaultPlotFontSize();
|
||||
CAF_PDM_InitField( &m_valuesFontSize, "ValuesFontSize", 10, "Font Size", "", "", "" );
|
||||
m_valuesFontSize = RiaFontCache::pointSizeFromFontSizeEnum(
|
||||
RiaApplication::instance()->preferences()->defaultPlotFontSize() );
|
||||
m_valuesFontSize = RiaApplication::instance()->preferences()->defaultPlotFontSize();
|
||||
|
||||
CAF_PDM_InitField( &m_automaticDateComponents, "AutoDate", true, "Automatic Date/Time Labels", "", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_dateComponents, "DateComponents", "Set Date Label", "", "", "" );
|
||||
|
||||
Reference in New Issue
Block a user