diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-12-25 19:37:53 +0100 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2020-01-05 16:04:31 +0100 |
commit | 56674dca36f113369d3ed598192a392ceb723605 (patch) | |
tree | 47f83a97e1ca7fae6f3fc4e2371e52f9dfd889cc /src/widgets/styles | |
parent | 9b647bf5acf6a5bd4bf87646feed7b19960fc274 (diff) |
QSS/QComboBox: set correct palette when drawing SC_ComboBoxArrow
When the dropdown button of a combobox is drawn with QStyleSheetStyle,
not only the background color is used for drawing but also
QPalette::Light/Dark/Shadow. Since the palette was not properly set up
in some cases, the shaded frame around the button was drawn with the
default colors instead the ones derived from the given background.
Therefore we have to properly set up the palette before drawing the drop
down button by calling QRenderRule::configurePalette()
Fixes: QTBUG-80950
Change-Id: Ibf98fa28612b5c7527ef9dd6ae06c417315f2632
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/widgets/styles')
-rw-r--r-- | src/widgets/styles/qstylesheetstyle.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index 98c85684ae..c694e9db97 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -3019,6 +3019,7 @@ void QStyleSheetStyle::drawComplexControl(ComplexControl cc, const QStyleOptionC r = positionRect(w, subRule, subRule2, PseudoElement_ComboBoxArrow, r, opt->direction); subRule2.drawRule(p, r); } else { + rule.configurePalette(&cmbOpt.palette, QPalette::ButtonText, QPalette::Button); cmbOpt.subControls = QStyle::SC_ComboBoxArrow; QWindowsStyle::drawComplexControl(cc, &cmbOpt, p, w); } |