diff options
author | Gabriel de Dietrich <gabriel.dietrich-de@nokia.com> | 2009-09-21 13:32:51 (GMT) |
---|---|---|
committer | Gabriel de Dietrich <gabriel.dietrich-de@nokia.com> | 2009-09-21 14:00:27 (GMT) |
commit | 423cbcf1a26ce208d5440ffa0c7cd150ccfd8b3a (patch) | |
tree | fe3827e865c3bee03c41287d99ffffc474223cb6 /src | |
parent | 5759ee3ef9eea0a1ea06efd4c349ef7ecc35ab5e (diff) | |
download | Qt-423cbcf1a26ce208d5440ffa0c7cd150ccfd8b3a.zip Qt-423cbcf1a26ce208d5440ffa0c7cd150ccfd8b3a.tar.gz Qt-423cbcf1a26ce208d5440ffa0c7cd150ccfd8b3a.tar.bz2 |
When using Plastique style, changing the background style sheet property of a
spinbox wouldn't set the correct background for the embedded line edit.
Reviewed-by: Olivier
Task-number: 232085
Task-number: QTBUG-3013
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/styles/qplastiquestyle.cpp | 3 | ||||
-rw-r--r-- | src/gui/styles/qstylesheetstyle.cpp | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/styles/qplastiquestyle.cpp b/src/gui/styles/qplastiquestyle.cpp index 0b2d6a7..5052755 100644 --- a/src/gui/styles/qplastiquestyle.cpp +++ b/src/gui/styles/qplastiquestyle.cpp @@ -1056,7 +1056,8 @@ void QPlastiqueStylePrivate::drawPartialFrame(QPainter *painter, const QStyleOpt frameOpt.rect.adjust(reverse ? -2 : 0, 0, reverse ? 0 : 2, 0); frameOpt.lineWidth = q->pixelMetric(QStyle::PM_DefaultFrameWidth); frameOpt.midLineWidth = 0; - frameOpt.state |= QStyle::State_Sunken; + frameOpt.state = option->state | QStyle::State_Sunken; + frameOpt.palette = option->palette; q->drawPrimitive(QStyle::PE_PanelLineEdit, &frameOpt, painter, widget); painter->restore(); diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp index 9f2d245..e33b255 100644 --- a/src/gui/styles/qstylesheetstyle.cpp +++ b/src/gui/styles/qstylesheetstyle.cpp @@ -2903,6 +2903,7 @@ void QStyleSheetStyle::drawComplexControl(ComplexControl cc, const QStyleOptionC if (const QStyleOptionSpinBox *spin = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) { QStyleOptionSpinBox spinOpt(*spin); rule.configurePalette(&spinOpt.palette, QPalette::ButtonText, QPalette::Button); + rule.configurePalette(&spinOpt.palette, QPalette::Text, QPalette::Base); spinOpt.rect = rule.borderRect(opt->rect); bool customUp = true, customDown = true; QRenderRule upRule = renderRule(w, opt, PseudoElement_SpinBoxUpButton); @@ -4169,6 +4170,7 @@ void QStyleSheetStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *op QRenderRule spinboxRule = renderRule(w->parentWidget(), opt); if (!spinboxRule.hasNativeBorder() || !spinboxRule.baseStyleCanDraw()) return; + rule = spinboxRule; } #endif if (rule.hasNativeBorder()) { |