Bug: some ScrollBar colourIds never actually used in lookandfeel_v4

ScrollBar::backgroundColourId and ScrollBar::trackColourId are documented but afaict never referenced in the codebase. ideally these would be implemented in the drawScrollbar l+f method but at the bare minimum the references to those colourIds should be removed from the docs.

ScrollBar::backgroundColourId and ScrollBar::trackColourId are documented but not used in LookAndFeel_V4 which means out of the box neither has any effect. one could use the older versions of drawScrollbar but it’s not obvious that this is a possible solution.

They look used to me. I see this in LookAndFeel_V1:

    g.fillAll (bar.findColour (ScrollBar::backgroundColourId));

and this in LookAndFeel_V2:

    if (scrollbar.isColourSpecified (ScrollBar::trackColourId)
     || isColourSpecified (ScrollBar::trackColourId))
{
    trackColour1 = trackColour2 = scrollbar.findColour (ScrollBar::trackColourId);
}
else
1 Like

ah, you’re right. i guess there’s an issue in github search:

neither of these are used in lookandfeel v4 though, and as such they don’t have any effect out of the box. i still think that’s confusing, but it’s not as bad as the title indicates so i updated it.

Probably maintained for backwards-compatibility. You don’t have to use (or derive from) _V4, after all.

drawScrollBarButton is implemented in LookAndFeel_V1 and LookAndFeel_V2.
The LookAndFeel classes inherit from each other, which means in LookAndFeel_V3 and V4 they simply didn’t change the buttons.

What seems to have changed is that V3 and V4 don’t draw a background any longer, so Scrollbar::backgroundColourId seems indeed to have retired.

But thumbColourId seems present in all four LookAndFeel versions.

so i guess the overall issue is hard to solve - in nearly every other component class setting colourIds works without a custom lookandfeel class (or without deriving specifically from an older l+f version). this was the first case i saw where it didn’t work, and it cost me some time in debugging to realize why. i guess i’ll just leave this here with the hope that it helps someone else, thanks.

Just out of curiosity, does seting trackColourId work for you? Looking at the code it should work with all four available LookAndFeels V1-4.

also found a duplicate of this issue here: