commontk / CTK

A set of common support code for medical imaging, surgical navigation, and related purposes.
https://commontk.org
Apache License 2.0
855 stars 490 forks source link

ctkRangeSlider customization #1126

Closed jamesobutler closed 1 year ago

jamesobutler commented 1 year ago

Note: I'm using latest 3D Slicer for testing the implementation of these changes.

cc: @sjh26 since you also mentioned dealing with customization of this widget

With master:

window_level = slicer.qMRMLWindowLevelWidget()
window_level.show()

image

Then upon applying a customization for the disabled color of Sliders, there is no observed change

stylesheet = "QSlider:disabled {selection-background-color: green;}"  # green for visibility of this example
slicer.app.setStyleSheet(stylesheet)

image

Now with this PR:

By default the slider appears in a (more correct) disabled state look

window_level = slicer.qMRMLWindowLevelWidget()
window_level.show()

image

Then upon applying a customization for the disabled color of Sliders, you can actually observe a change

stylesheet = "QSlider:disabled {selection-background-color: green;}"  # green for visibility of this example
slicer.app.setStyleSheet(stylesheet)

image

sjh26 commented 1 year ago

🍾