Hi!
I’ve a request for changes to how viewport handles its scrollbars that may make sense to include in Juce. I know after searching the forum that the scrollbars in the viewport is something very sensitive to edit, but perhaps this won’t risk breaking anything still!
Now that touch screens are mainstream, the accessibility issue of scrollbar placement becomes important.
Left-handed users (I’m one of them) hate scrollbars to the right of a viewport, because scrolling then means that you hide the viewport content with your hand.
The solution is to have an option in the software, of having all scrollbars to the left instead. Currently, the only way this can be accomplished in Juce is replacing the viewport class entirely, with all the repercussion that has in modifying also all classes that use viewports (treeview, etc).
For a while I just made my own scrollbar, hid the ones in viewport, and re-implemented all functionality by listening to the relevant events in viewport and scrollbar. But then I ran into autoscroll not working, did not know how to fix that, and so gave up on the approach.
Perhaps the most flexible solution would be to allow programmers to manage scrollbar placement themselves completely, but still be allowed access to all relevant events in viewport (e.g. autoscroll)?
To go the furthest possible with this thought, in the most flexible of scenarios which could be useful for more than just leftie-compatibility, a scrollbar could be linked to n viewports, so that for example a ruler viewport could be placed next to a content viewport, and any scrolling within any of the viewports would be propagated to their common scrollbar, and to the other viewports. This would too be nice to have but may be too far out, still, it’s a thought
Anyway, back to normality: I’ve managed to grab the scrollbar and have it be owned by the containing component, so that it can be re-positioned, but the below code in Viewport’s updatevisiblearea() ruins it for me:
(...)
if (vBarVisible)
{
verticalScrollBar.setBounds (contentArea.getWidth(), 0, scrollbarWidth, contentArea.getHeight());
(...)
}
Finally, since I might have missed something, perhaps the functionality I’m asking for is possible and I just don’t know how to do it, making all the above irrelevant?