mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Regression test fixes (#9068)
* Make sure font size is updated correctly * Hide empty sub titles * Do not categorize as water cut if no curves are visible * Propagate settings from single summary plot to summary multi plot
This commit is contained in:
@@ -41,6 +41,16 @@ RiuAbstractOverlayContentFrame::~RiuAbstractOverlayContentFrame()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuAbstractOverlayContentFrame::updateFontSize()
|
||||
{
|
||||
QFont font = this->font();
|
||||
font.setPixelSize( caf::FontTools::pointSizeToPixelSize( RiaPreferences::current()->defaultPlotFontSize() ) );
|
||||
this->setFont( font );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -52,9 +62,7 @@ RiuTextOverlayContentFrame::RiuTextOverlayContentFrame( QWidget* parent /*= null
|
||||
m_textLabel = new QLabel;
|
||||
layout->addWidget( m_textLabel );
|
||||
|
||||
QFont font = m_textLabel->font();
|
||||
caf::FontTools::pointSizeToPixelSize( RiaPreferences::current()->defaultPlotFontSize() );
|
||||
m_textLabel->setFont( font );
|
||||
updateLabelFont();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -70,6 +78,8 @@ void RiuTextOverlayContentFrame::setText( const QString& text )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuTextOverlayContentFrame::renderTo( QPainter* painter, const QRect& targetRect )
|
||||
{
|
||||
updateLabelFont();
|
||||
|
||||
painter->save();
|
||||
painter->translate( targetRect.topLeft() + QPoint( this->contentsMargins().left(), this->contentsMargins().top() ) );
|
||||
painter->setFont( m_textLabel->font() );
|
||||
@@ -81,3 +91,13 @@ void RiuTextOverlayContentFrame::renderTo( QPainter* painter, const QRect& targe
|
||||
|
||||
painter->restore();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuTextOverlayContentFrame::updateLabelFont()
|
||||
{
|
||||
QFont font = m_textLabel->font();
|
||||
font.setPixelSize( caf::FontTools::pointSizeToPixelSize( RiaPreferences::current()->defaultPlotFontSize() ) );
|
||||
m_textLabel->setFont( font );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user