Setting slider thumb limits


#1

I'm pretty new to JUCE & have an issue with sliders I have skinned using a custom lookAndFeel. I'm drawing the slider thumb image with drawLinearSliderThumb which works great. But, at the top and bottom of the sliders range part of the image im using for the thumd gets clipped / goes out of view. How do i tune each slider so that the thumb is fully drawn at the ends of the sliter track?


#2

Hi,

I haven't tried overriding drawLinearSliderThumb() yet in terms of custom Look&Feel definition, so my remark may be stupid, but can't you redefine the component's height ? Either in the Look&Feel or by subclassing it ?


#3

Yea, I can change the slider bounds, but that just makes the height shorter and then thumb image still goes out of view


#4

Presumably you need to reduce the size of the track that the thumb moves along?


#5

That sounds exactly like what I need to do - How do I modify the slider track size?


#6

All the lookandfeel methods are listed in Slider::LookAndFeelMethods. Maybe getSliderThumbRadius()?


#7

Ok i see how I can do this now. It seemed more obvious to look for a way to shorten the slider run by thumbImageHeight/2 rather than this function that returns the size the thumb.