forked from qt-creator/qt-creator
Utils: Fix setting of minimal height of InfoLabels in QFormLayout
Calling setMinimumHeight is not compatible with QFormLayout if the label has multiple lines. Overriding minimumSizeHint on the other hand is. Change-Id: Id2167b295620322cec75035d7cc7125cc3221c4d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -45,7 +45,6 @@ InfoLabel::InfoLabel(const QString &text, InfoType type, QWidget *parent)
|
||||
: ElidingLabel(text, parent)
|
||||
{
|
||||
setType(type);
|
||||
setMinimumHeight(iconSize);
|
||||
}
|
||||
|
||||
InfoLabel::InfoType InfoLabel::type() const
|
||||
@@ -70,6 +69,13 @@ void InfoLabel::setFilled(bool filled)
|
||||
m_filled = filled;
|
||||
}
|
||||
|
||||
QSize InfoLabel::minimumSizeHint() const
|
||||
{
|
||||
QSize baseHint = ElidingLabel::minimumSizeHint();
|
||||
baseHint.setHeight(qMax(baseHint.height(), iconSize));
|
||||
return baseHint;
|
||||
}
|
||||
|
||||
static Utils::Theme::Color fillColorForType(InfoLabel::InfoType type)
|
||||
{
|
||||
using namespace Utils;
|
||||
|
||||
Reference in New Issue
Block a user