It seems that setAutoHide(false) no longer work, the scrollbar is displayed only when needed, just like when you specify “true”.
Furthermore, the width passed to the method ListBoxModel: paintListBoxItem() seems to reflect the presence of the invisible scrollbar, but sometimes, when the list is initialized, a full width (including the scrollbar width) is passed.
I checked several times and indeed, at least on Windows with VC 7, the problem exists.
I tried to trace the JUCE code, but without success. Could you suggest how I could try to identify the problem or provide you with the best information to trace the cause?
My initialization code is as follows:[code]PatchesList::PatchesList()
: ListBox(T(“PatchesList”), NULL)
{
s_Instance = this;
auto-hide certainly does work, otherwise every TextEditor and Viewport would have scrollbars all over the place.
Not sure what to suggest, but presumably it’s not hiding because your total range isn’t smaller than your visible range… Perhaps just a numerical error somewhere?
I don’t know exactly what this piece of code is doing, but if you comment line #187 of juce_Viewport.cpp:verticalScrollBar->setVisible (false); you obtain the expected behaviour using both setAutoHide(false) and setAutoHide(true).
Ah, I thought you were just talking about scrollbars, not the Viewport class. The viewport handles it differently, and takes control of auto-hiding - not sure if it’s capable of having always-visible scrollbars…
This used to set the ScrollBar of a ViewPort to be always visible, which is what you expect when calling setAutoHide(false).
Unfortunately this is broken now and does not have any effect anymore.
Could you please reimplement the old functionality.
Thanks
Oh yes.
And I noticed that calling autoScroll in a viewport while its scrollbars are not visible
doesn’t affect the viewport (it does no autoscrolling).