From 72b03e268d3ed23c7b83c71877a18000578c2d41 Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Tue, 16 Jan 2024 13:50:25 +0100 Subject: [PATCH] QFusionStyle: draw slider in a scrollbar using lighter color The gradient we are using now, makes slider almost invisible in 'Dark' theme (non-transient scroll bar). Instead of using gradient for non-selected and non-pressed state, use the same color as in pressed state. Fixes: QTBUG-120971 Change-Id: I1a7e4aefa4483e8095e59d82be3d0c1c3526b28f Reviewed-by: Axel Spoerl Reviewed-by: Qt CI Bot --- src/widgets/styles/qfusionstyle.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp index 9a42ac579e2..48d4ec81bb2 100644 --- a/src/widgets/styles/qfusionstyle.cpp +++ b/src/widgets/styles/qfusionstyle.cpp @@ -2478,8 +2478,10 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption painter->setBrush(midColor2); else if (option->state & State_MouseOver && scrollBar->activeSubControls & SC_ScrollBarSlider) painter->setBrush(highlightedGradient); - else + else if (!isDarkBg) painter->setBrush(gradient); + else + painter->setBrush(midColor2); painter->drawRect(pixmapRect.adjusted(horizontal ? -1 : 0, horizontal ? 0 : -1, horizontal ? 0 : -1, horizontal ? -1 : 0));