Viewport & custom scrollBars

Could we get a virtual method added to Viewport that would be called to create each scrollbar :

virtual ScrollBar* createScrollBarComponent (bool isVertical);

That would allow us to set up custom scrollbars (for more than simple lnf tweaks) through subclassing.
edit: fixed typo in the patch
patch.txt (8,8 Ko)

Seems like a sensible request, I’ll sort that out, ta.

1 Like

I left a comment here:
but I’m not sure if that will reach the right people…

Here it is for visibility:

I can’t see how this is going to work if createScrollBarComponent is called during the constructor as derived classes won’t have been constructed yet so it can’t call any overridden method. It always calls Viewport::createScrollBarComponent.

Perhaps we need a refreshScrollbars method or similar?

hmm, good point, I’ll take a look.