vertical slider

Started by Valfar, 30 December 2017, 04:09:33

Valfar

First of all thank you for this library, It's awesome! I'm new to programming and I've been learning this library and the results are very good. There have been some great moments like using the unbound system and when I succeeded converting the 0.6 scrollable panel example to a 0.7 version and all this inside a class 8) lol.

Now I need to make vertical sliders. I tried slider->setVerticalScroll(true); but I guess it's no longer the way to do it? it must be with the renderer? If you could you show me a quick example of how to do it in 0.7 that would be great.


texus

I removed the setVerticalScroll function because it will now be automatically determined based on the size of the slider. So you just have to call setSize with a larger height than width and the slider will become a vertical one.

Valfar


Kvaz1r

I think it would be good to mention about how making slider vertical in documentation because it's not very obvious. 
I actually already wanted to create a new topic but decided use search first ;-)

texus

I'm not sure where to best document it.
Maybe we just need to add setVerticalScroll back, but still keeping the automatic detection based on size. So all existing code would still work, but you would also be able to call setVerticalScroll which would swap width and height values if they don't correspond to the requested direction. That way it might be more intuitive to use.

Kvaz1r

Quote from: texus on 08 September 2019, 11:29:39
I'm not sure where to best document it.
I guess, or into detailed description or as comment to setSize usage example.

Quote from: texus on 08 September 2019, 11:29:39
Maybe we just need to add setVerticalScroll back, but still keeping the automatic detection based on size. So all existing code would still work, but you would also be able to call setVerticalScroll which would swap width and height values if they don't correspond to the requested direction. That way it might be more intuitive to use.
Yes, it would be great.

texus

setVerticalScroll has been added again to Slider, Scrollbar and SpinButton