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.6 6.5 6.2 5.15
Change-Id: I45baf9127aea96bfe84a7410dd592a084f14f13c
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit e9438da42a2ce3c470df01f82245dbfa7901f8db)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Christian Ehrlicher 2023-12-29 15:25:30 +01:00 committed by Qt Cherry-pick Bot
parent 7c22796a97
commit 5278624b62

View File

@ -334,10 +334,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) {
@ -2733,13 +2733,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);