Scrollbar L&F issue

Hi Jules,

There is an issue with track colour for Scrollbar.
If you set it in L&F, it is not taken in account while drawing process.
Indeed, ::drawScrollbar() function on line 805 only looks at track colour specified in scrollbar object, and not in lookandfeel !
Can you manage this to make it work ?

Best regards

No… the Component::findColour method does ask the lookandfeel object for the colour, if one hasn’t been specified in the scrollbar itself. So if it’s not picking up the colour from the l+f, I guess the scrollbar must have a colour explicitly set somewhere. You could use Component::removeColour to make sure it’s not specified?

Hi,

I do know that and it is why I am coming here to ask you for modification.
In fact, at line 805 of L+F implementation, you will find this line :

Doing this, colour is not searched into L+F but only in scrollbar references !
If I am wrong, please explain me why my colour has been taken in account after overriding the drawScrollbar function using .findColour at this point ?

Best regards

Ah, sorry, I see what you mean. Hmm, it’s a bit of a special case. I suppose it could be changed to:

if (scrollbar.isColourSpecified (ScrollBar::trackColourId) || isColourSpecified (ScrollBar::trackColourId)) {

Yes, it is what I have done and it works perfectly.
Can you include this change in next commit ?

Yes, will do. Thanks!

Thanks you ! :wink: