Apply stylesheet for `ctkRangeSlider`

Hi,

Is there a way to change ctkRangeSlider color filled between min and max values?
image

I look in the source code of ctkRangeSlider and I can’t understand what parameter controls this.
The original QSlider seems to have no option to control this color.

Also where are Slicer dark and light themes are defined?
I’m not much familiar with styling but I expected that Slicer use some Qt Style Sheet (probably some .css file) but instead I can see classes like (slicersources-src/Base/QTGUI) qSlicerStyle, qSlicerDarkStyle, qSlicerLightStyle inherited form ctkProxyStyleQProxyStyle. Are these classes are fully responsible (or almost fully responsible) for Slicer GUI style?

Widgets use colors based on the ColorRole from the Palette. This provides a theme of colors used consistently across the GUI.

I believe a Qt slider’s active range uses the QPalette::Highlight specification. You’re showing Slicer when it is using the Slicer Dark mode, so the Highlight color of the QPalette for Slicer Dark is at:

1 Like

Thank you very much,

You were right!

It took some time to understand how to create custom style plugin so that it is visible in Slicer->Edit->Application Settings->Appearance->Themes but after I did that I could change the color of ctkRangeSlicer
image

1 Like