Viewport request: set ScrollBars always visible


#1

Hi,
I have a request regarding the ScrollBar behaviour of the Viewport class:
It would be nice to have an option to keep the ScrollBars always visible, even if there is nothing to scroll. In this way, a ScrollBar could act as a kind of separator, too, like it is done in the Mac OSX finder (see the picture).

I’ve changed the Viewport class to do that and it’s not that much work, but it would be cool to have it in the official juce tip.
What do you think of it?


#2

Yes, not a bad idea…


#3

Ok, I found out that almost the whole thing is already there.
You can simply call

But for TreeViews or similar Components it only works if there is some item added to the ViewPort. If a TreeView has no items, the ScrollBars aren’t shown. As soon as the first item is added, the Scrollbars appear.


#4

I have similar UI requirements most of the times , and I end up painting the scroll Bar, which shows up when Viewport class doesn’t create scroll bar. This option would be very useful. :stuck_out_tongue: