drawScrollbar jitters


#1

When i draw the thumb button in drawScrollbar a bit bigger (to overlap the scrollbarbuttons) it does not correctly paint the scrollbar when i move the slider. only when the mouse is released is the whole slider updated correctly. I guess during the sliding only the area as big as the thumbStartPosition + thumbSize is updated.

Is there anything i can do to correct this?

I,d like to draw the scrollbar without any buttons on the top (or side).

void AvenueLookAndFeel::drawScrollbar (Graphics& g,
                                      ScrollBar& s,
                                      int x, int y,
                                      int width, int height,
                                      bool isScrollbarVertical,
                                      int thumbStartPosition,
                                      int thumbSize,
                                      bool /*isMouseOver*/,
                                      bool /*isMouseDown*/)
{
	//background
	g.setColour (colourBackGroundLight);
	g.fillRoundedRectangle (0.0f, 0.0f, width, height + (2*getScrollbarButtonSize(s)), 4.0000f);
	
	//slider button
	g.setColour (colourButtonUp);
    if (isScrollbarVertical)
    {
        if (thumbSize > 0)
		{
			g.fillRoundedRectangle (x,
									thumbStartPosition - getScrollbarButtonSize(s),
									width,
									thumbSize + (2*getScrollbarButtonSize(s)),
									4.0f);
		}
    }
    else
    {
        if (thumbSize > 0)
		{
			g.fillRoundedRectangle (thumbStartPosition - getScrollbarButtonSize(s),
									y,
									thumbSize + (2*getScrollbarButtonSize(s)),
									height,
									4.0f);
		}
    }

}

#2

That’d involve some changes to the scrollbar code itself. I’m playing around with look and feel stuff at the moment so will see if I can add something to make it a bit more versatile.


#3

hope the new look and feel stuff is not going to break too much but i guess we,ll love you for it in the end.

in the meantime i fixed it by making getScrollbarButtonSize return 0. Don,t know if this hack will bite back at some point though.


#4