#2304 Property Editor: Box header text not readable

Modify title label palette before modifying the frame palette
This commit is contained in:
Magne Sjaastad 2018-01-03 09:43:33 +01:00
parent 5af63f7abd
commit 24aca6edc3

View File

@ -138,6 +138,10 @@ void QMinimizePanel::initialize(const QString &title)
m_titleFrame->setFrameStyle(QFrame::Box | QFrame::Plain);
m_titleFrame->setAutoFillBackground(true);
m_titleLabel = new QLabel(title, m_titleFrame);
QPalette titleLabelPalette = m_titleLabel->palette();
titleLabelPalette.setBrush(QPalette::Foreground, titleLabelPalette.windowText());
{
QLinearGradient titleGrad(QPointF(0, 0), QPointF(0, 1));
titleGrad.setCoordinateMode(QGradient::StretchToDeviceMode);
@ -150,8 +154,7 @@ void QMinimizePanel::initialize(const QString &title)
m_titleFrame->setPalette(titleFramePalette);
}
m_titleLabel = new QLabel(title, m_titleFrame);
m_titleLabel->setPalette(QApplication::palette()); // To avoid title foreground color bleeding through
m_titleLabel->setPalette(titleLabelPalette);
m_collapseButton = new QPushButton( m_titleFrame);
m_collapseButton->setFlat(true);