Skip to content

Commit

Permalink
BUG: Fix inability to customize ctkRangeSlider filled color
Browse files Browse the repository at this point in the history
Previously, when specifying the below customization at the QApplication level stylesheet, the ctkRangeSlider filled color would not change.

QSlider:disabled {
    selection-background-color: #767676;
}
  • Loading branch information
jamesobutler authored and lassoan committed Jul 21, 2023
1 parent 2368077 commit 2b16f9d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Libs/Widgets/ctkRangeSlider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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));

Expand Down

0 comments on commit 2b16f9d

Please sign in to comment.