mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-21 22:13:25 -06:00
#1365 Added sizeHint to QMinimizePanel
This commit is contained in:
parent
dc493b0b68
commit
bf9d65d249
@ -189,6 +189,28 @@ QString QMinimizePanel::title() const
|
||||
return m_titleLabel->text();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QSize QMinimizePanel::sizeHint() const
|
||||
{
|
||||
QSize labelSize = m_titleLabel->sizeHint();
|
||||
QSize titleBarHint = labelSize + QSize(4 + labelSize.height() + 8 - 2 + 1, 8);
|
||||
|
||||
if (!m_contentFrame->isHidden())
|
||||
{
|
||||
QSize titleBarMin(0, labelSize.height() + 8);
|
||||
QSize contentsMin(m_contentFrame->sizeHint());
|
||||
QSize total = contentsMin.expandedTo(titleBarMin);
|
||||
total.rheight() += titleBarMin.height();
|
||||
return total;
|
||||
}
|
||||
else
|
||||
{
|
||||
return titleBarHint;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -53,6 +53,7 @@ public:
|
||||
QFrame * contentFrame() { return m_contentFrame; }
|
||||
void setTitle (const QString& title);
|
||||
QString title() const;
|
||||
virtual QSize sizeHint() const override;
|
||||
|
||||
public slots:
|
||||
void setExpanded(bool isExpanded);
|
||||
|
Loading…
Reference in New Issue
Block a user