Allow RangeSlider to adjust both values to the same number
Hi @tlambert03
I have a use case where I want to select a range using the RangeSlider AND I also want the same slider to allow me a single value.
For example:
range = (0-3) --> will read planes 0,1,2,3 from my image stack range = (2-2) --> will read only plane 3 from the stack
But this 2nd case does not seem to be possible because the UI element does not allow to adjust both handles to be the same?
Is that even possible or do you advice to use two sliders (min & max) with some custom logic?
It's true, the range slider (which comes from superqt) doesn't let the slider handles sit on top of each other.
Your use case is a good/common one. I have a similar need elsewhere (in ndv) ... and there I do indeed use two sliders and switch between them (e.g. using a QStackWidget) based on the need. While it would be nice to offer such a "super-slider" that is smart enough to seamlessly switch between integer and slice-based indexing, I think it is probably best done as a new object that switches between the two (rather than updating range slider to have that functionality directly).
I'm afraid we don't offer such a nicely integrated widget at the moment, so you'll have to roll your own. but it would be great feature
Hi @tlambert03
Thx. Good to know. Maybe for now I use something like shown below. That is not perfect but it does the job. This way I can at least check if my littele CZIReader in Napari works as expected.
And improving the UI later can be done based on demand. :-)