 src/widgets/styles/qfusionstyle.cpp | 128 +++++++++++++++++++-----------------
 1 file changed, 69 insertions(+), 59 deletions(-)

diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp
index b0bc41739cd..76349fa0e0f 100644
--- a/src/widgets/styles/qfusionstyle.cpp
+++ b/src/widgets/styles/qfusionstyle.cpp
@@ -2666,6 +2666,7 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption
             QRect handle = proxy()->subControlRect(CC_Slider, option, SC_SliderHandle, widget);
 
             bool horizontal = slider->orientation == Qt::Horizontal;
+            bool enabled    = slider->state & State_Enabled;
             bool ticksAbove = slider->tickPosition & QSlider::TicksAbove;
             bool ticksBelow = slider->tickPosition & QSlider::TicksBelow;
             QColor activeHighlight = d->highlight(option->palette);
@@ -2693,76 +2694,85 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption
                     QPainter groovePainter(&cache);
                     groovePainter.setRenderHint(QPainter::Antialiasing, true);
                     groovePainter.translate(0.5, 0.5);
-                    QLinearGradient gradient;
-                    if (horizontal) {
-                        gradient.setStart(pixmapRect.center().x(), pixmapRect.top());
-                        gradient.setFinalStop(pixmapRect.center().x(), pixmapRect.bottom());
+                    groovePainter.setPen(QPen(outline));
+                    if (enabled)
+                    {
+                        QLinearGradient gradient;
+                        if (horizontal) {
+                            gradient.setStart(pixmapRect.center().x(), pixmapRect.top());
+                            gradient.setFinalStop(pixmapRect.center().x(), pixmapRect.bottom());
+                        }
+                        else {
+                            gradient.setStart(pixmapRect.left(), pixmapRect.center().y());
+                            gradient.setFinalStop(pixmapRect.right(), pixmapRect.center().y());
+                        }
+                        gradient.setColorAt(0, grooveColor.darker(110));
+                        gradient.setColorAt(1, grooveColor.lighter(110));//palette.button().color().darker(115));
+                        groovePainter.setBrush(gradient);
                     }
-                    else {
-                        gradient.setStart(pixmapRect.left(), pixmapRect.center().y());
-                        gradient.setFinalStop(pixmapRect.right(), pixmapRect.center().y());
+                    else
+                    {
+                        groovePainter.setBrush(Qt::NoBrush);
                     }
-                    groovePainter.setPen(QPen(outline));
-                    gradient.setColorAt(0, grooveColor.darker(110));
-                    gradient.setColorAt(1, grooveColor.lighter(110));//palette.button().color().darker(115));
-                    groovePainter.setBrush(gradient);
                     groovePainter.drawRoundedRect(pixmapRect.adjusted(1, 1, -2, -2), 1, 1);
                     groovePainter.end();
                     QPixmapCache::insert(groovePixmapName, cache);
                 }
                 painter->drawPixmap(groove.topLeft(), cache);
-
                 // draw blue groove highlight
-                QRect clipRect;
-                if (!groovePixmapName.isEmpty())
-                    groovePixmapName += "_blue"_L1;
-                if (!QPixmapCache::find(groovePixmapName, &cache)) {
-                    cache = styleCachePixmap(pixmapRect.size(), dpr);
-                    QPainter groovePainter(&cache);
-                    QLinearGradient gradient;
-                    if (horizontal) {
-                        gradient.setStart(pixmapRect.center().x(), pixmapRect.top());
-                        gradient.setFinalStop(pixmapRect.center().x(), pixmapRect.bottom());
+                if (enabled) 
+                {
+                    QRect clipRect;
+                    if (!groovePixmapName.isEmpty())
+                        groovePixmapName += "_blue"_L1;
+                    if (!QPixmapCache::find(groovePixmapName, &cache)) {
+                        cache = styleCachePixmap(pixmapRect.size(), dpr);
+                        QPainter groovePainter(&cache);
+                        QLinearGradient gradient;
+                        if (horizontal) {
+                            gradient.setStart(pixmapRect.center().x(), pixmapRect.top());
+                            gradient.setFinalStop(pixmapRect.center().x(), pixmapRect.bottom());
+                        }
+                        else {
+                            gradient.setStart(pixmapRect.left(), pixmapRect.center().y());
+                            gradient.setFinalStop(pixmapRect.right(), pixmapRect.center().y());
+                        }
+                        QColor highlight = d->highlight(option->palette);
+                        QColor highlightedoutline = highlight.darker(140);
+                        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(grooveOutline));
+                        gradient.setColorAt(0, activeHighlight);
+                        gradient.setColorAt(1, activeHighlight.lighter(130));
+                        groovePainter.setBrush(gradient);
+                        groovePainter.drawRoundedRect(pixmapRect.adjusted(1, 1, -2, -2), 1, 1);
+                        groovePainter.setPen(d->innerContrastLine());
+                        groovePainter.setBrush(Qt::NoBrush);
+                        groovePainter.drawRoundedRect(pixmapRect.adjusted(2, 2, -3, -3), 1, 1);
+                        groovePainter.end();
+                        QPixmapCache::insert(groovePixmapName, cache);
                     }
-                    else {
-                        gradient.setStart(pixmapRect.left(), pixmapRect.center().y());
-                        gradient.setFinalStop(pixmapRect.right(), pixmapRect.center().y());
+                    if (horizontal) {
+                        if (slider->upsideDown)
+                            clipRect = QRect(handle.right(), groove.top(), groove.right() - handle.right(), groove.height());
+                        else
+                            clipRect = QRect(groove.left(), groove.top(),
+                                             handle.left() - slider->rect.left(), groove.height());
+                    } else {
+                        if (slider->upsideDown)
+                            clipRect = QRect(groove.left(), handle.bottom(), groove.width(), groove.height() - (handle.bottom() - slider->rect.top()));
+                        else
+                            clipRect = QRect(groove.left(), groove.top(), groove.width(), handle.top() - groove.top());
                     }
-                    QColor highlight = d->highlight(option->palette);
-                    QColor highlightedoutline = highlight.darker(140);
-                    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(grooveOutline));
-                    gradient.setColorAt(0, activeHighlight);
-                    gradient.setColorAt(1, activeHighlight.lighter(130));
-                    groovePainter.setBrush(gradient);
-                    groovePainter.drawRoundedRect(pixmapRect.adjusted(1, 1, -2, -2), 1, 1);
-                    groovePainter.setPen(d->innerContrastLine());
-                    groovePainter.setBrush(Qt::NoBrush);
-                    groovePainter.drawRoundedRect(pixmapRect.adjusted(2, 2, -3, -3), 1, 1);
-                    groovePainter.end();
-                    QPixmapCache::insert(groovePixmapName, cache);
-                }
-                if (horizontal) {
-                    if (slider->upsideDown)
-                        clipRect = QRect(handle.right(), groove.top(), groove.right() - handle.right(), groove.height());
-                    else
-                        clipRect = QRect(groove.left(), groove.top(),
-                                         handle.left() - slider->rect.left(), groove.height());
-                } else {
-                    if (slider->upsideDown)
-                        clipRect = QRect(groove.left(), handle.bottom(), groove.width(), groove.height() - (handle.bottom() - slider->rect.top()));
-                    else
-                        clipRect = QRect(groove.left(), groove.top(), groove.width(), handle.top() - groove.top());
+                    painter->save();
+                    painter->setClipRect(clipRect.adjusted(0, 0, 1, 1), Qt::IntersectClip);
+                    painter->drawPixmap(groove.topLeft(), cache);
+                    painter->restore();
                 }
-                painter->save();
-                painter->setClipRect(clipRect.adjusted(0, 0, 1, 1), Qt::IntersectClip);
-                painter->drawPixmap(groove.topLeft(), cache);
-                painter->restore();
             }
 
             if (option->subControls & SC_SliderTickmarks) {
