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 <axel.spoerl@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Timur Pocheptsov 2024-01-16 13:50:25 +01:00
parent d880351553
commit 72b03e268d

View File

@ -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));