From 63487e956659e1bace51371a61bd54bba272ba8e Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Fri, 29 Dec 2023 15:25:30 +0100 Subject: [PATCH] CommonStyle/QSlider: don't modify outline color The outline color was modified under some conditions but used afterwards independently from this condition which lead to a wrong tickmark color. Pick-to: 6.5 6.2 5.15 Change-Id: I45baf9127aea96bfe84a7410dd592a084f14f13c Reviewed-by: Axel Spoerl (cherry picked from commit e9438da42a2ce3c470df01f82245dbfa7901f8db) Reviewed-by: Qt Cherry-pick Bot (cherry picked from commit 5278624b62f0a4cfacff3aebc358672665ab3be3) --- src/widgets/styles/qfusionstyle.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp index 0015752af37..54a3f3e4de3 100644 --- a/src/widgets/styles/qfusionstyle.cpp +++ b/src/widgets/styles/qfusionstyle.cpp @@ -424,10 +424,10 @@ void QFusionStyle::drawPrimitive(PrimitiveElement elem, QRect rect = option->rect; int state = option->state; - QColor outline = d->outline(option->palette); - QColor highlightedOutline = d->highlightedOutline(option->palette); + const QColor outline = d->outline(option->palette); + const QColor highlightedOutline = d->highlightedOutline(option->palette); - QColor tabFrameColor = d->tabFrameColor(option->palette); + const QColor tabFrameColor = d->tabFrameColor(option->palette); switch (elem) { @@ -2830,13 +2830,13 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption } QColor highlight = d->highlight(option->palette); QColor highlightedoutline = highlight.darker(140); - if (qGray(outline.rgb()) > qGray(highlightedoutline.rgb())) - outline = highlightedoutline; - + QColor grooveOutline = outline; + if (qGray(grooveOutline.rgb()) > qGray(highlightedoutline.rgb())) + grooveOutline = highlightedoutline; groovePainter.setRenderHint(QPainter::Antialiasing, true); groovePainter.translate(0.5, 0.5); - groovePainter.setPen(QPen(outline)); + groovePainter.setPen(QPen(grooveOutline)); gradient.setColorAt(0, activeHighlight); gradient.setColorAt(1, activeHighlight.lighter(130)); groovePainter.setBrush(gradient);