[UXTHEME] Improve drawing of the scrollbars when they are too small. CORE-13513

This commit is contained in:
Giannis Adamopoulos 2017-11-23 21:17:03 +02:00
parent 73bfc3c897
commit 68af472a21

View file

@ -126,6 +126,9 @@ static enum SCROLL_HITTEST SCROLL_HitTest( HWND hwnd, SCROLLBARINFO* psbi, BOOL
static void SCROLL_ThemeDrawPart(PDRAW_CONTEXT pcontext, int iPartId,int iStateId, SCROLLBARINFO* psbi, int htCurrent, int htDown, int htHot, RECT* r)
{
if (r->right <= r->left || r->bottom <= r->top)
return;
if(psbi->rgstate[htCurrent] & STATE_SYSTEM_UNAVAILABLE)
iStateId += BUTTON_DISABLED - BUTTON_NORMAL;
else if (htHot == htCurrent)
@ -187,17 +190,22 @@ static void SCROLL_DrawInterior( PDRAW_CONTEXT pcontext, SCROLLBARINFO* psbi,
r = psbi->rcScrollBar;
if (vertical)
{
thumbPos += pcontext->wi.rcClient.top - pcontext->wi.rcWindow.top;
if (thumbPos)
thumbPos += pcontext->wi.rcClient.top - pcontext->wi.rcWindow.top;
r.top += psbi->dxyLineButton;
r.bottom -= (psbi->dxyLineButton);
}
else
{
thumbPos += pcontext->wi.rcClient.left - pcontext->wi.rcWindow.left;
if (thumbPos)
thumbPos += pcontext->wi.rcClient.left - pcontext->wi.rcWindow.left;
r.left += psbi->dxyLineButton;
r.right -= psbi->dxyLineButton;
}
if (r.right <= r.left || r.bottom <= r.top)
return;
/* Draw the scroll rectangles and thumb */
if (!thumbPos) /* No thumb to draw */