diff options
author | J-P Nurmi <jpnurmi@theqtcompany.com> | 2014-10-30 12:39:10 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2014-10-30 21:29:45 +0100 |
commit | 4387c5d6af49976318f7ca04c7a47b81a9cb19cc (patch) | |
tree | 6f60d6c2ab1426863aa07a9a164195a677e78d73 /src | |
parent | f3fb787a32aee43441c5802a406f8dbd1eb0a1d6 (diff) |
QWindowsStyle: fix CE_ComboBoxLabel text color
CE_ComboBoxLabel was relying on a font color / painter pen set
by CC_ComboBox. This change ensures that CE_ComboBoxLabel has
correct color when CC_ComboBox and CE_ComboBoxLabel are drawn
independently.
Change-Id: Id548d831fdde5885bc7c157d55de6235ef3f0a56
Task-number: QTBUG-41702
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/widgets/styles/qwindowsstyle.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/widgets/styles/qwindowsstyle.cpp b/src/widgets/styles/qwindowsstyle.cpp index 708014a6df..a10bdc67e1 100644 --- a/src/widgets/styles/qwindowsstyle.cpp +++ b/src/widgets/styles/qwindowsstyle.cpp @@ -1821,6 +1821,20 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai } return; #endif // QT_NO_DOCKWIDGET +#ifndef QT_NO_COMBOBOX + case CE_ComboBoxLabel: + if (const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) { + if (cb->state & State_HasFocus) { + p->setPen(cb->palette.highlightedText().color()); + p->setBackground(cb->palette.highlight()); + } else { + p->setPen(cb->palette.text().color()); + p->setBackground(cb->palette.background()); + } + } + QCommonStyle::drawControl(ce, opt, p, widget); + break; +#endif // QT_NO_COMBOBOX default: QCommonStyle::drawControl(ce, opt, p, widget); } |