From 56674dca36f113369d3ed598192a392ceb723605 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Wed, 25 Dec 2019 19:37:53 +0100 Subject: 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 Reviewed-by: Timur Pocheptsov --- src/widgets/styles/qstylesheetstyle.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/widgets/styles') 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); } -- cgit v1.2.3