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:
Magne Sjaastad
2022-06-21 14:40:54 +02:00
committed by GitHub
parent b4e3586e2c
commit 8aaf98823a
11 changed files with 110 additions and 51 deletions

View File

@@ -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 );
}