From 2b16f9dff6ce6a1ddf5589eea4878e3cad0fc951 Mon Sep 17 00:00:00 2001 From: James Butler Date: Fri, 21 Jul 2023 09:17:39 -0400 Subject: [PATCH] BUG: Fix inability to customize ctkRangeSlider filled color Previously, when specifying the below customization at the QApplication level stylesheet, the ctkRangeSlider filled color would not change. QSlider:disabled { selection-background-color: #767676; } --- Libs/Widgets/ctkRangeSlider.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Libs/Widgets/ctkRangeSlider.cpp b/Libs/Widgets/ctkRangeSlider.cpp index 556500805f..93ad6b68d9 100644 --- a/Libs/Widgets/ctkRangeSlider.cpp +++ b/Libs/Widgets/ctkRangeSlider.cpp @@ -596,7 +596,7 @@ void ctkRangeSlider::paintEvent( QPaintEvent* ) // Create default colors based on the transfer function. // - QColor highlight = this->palette().color(QPalette::Normal, QPalette::Highlight); + QColor highlight = this->palette().color(QPalette::Highlight); QLinearGradient gradient; if (option.orientation == Qt::Horizontal) { @@ -613,6 +613,7 @@ void ctkRangeSlider::paintEvent( QPaintEvent* ) //QColor l = Qt::darkGray; //QColor u = Qt::black; + // Like Fusion Style to match QSlider gradient.setColorAt(0, highlight.darker(120)); gradient.setColorAt(1, highlight.lighter(160));