win32ss/user/ntuser/scrollbar.c | 49 +++++++++++++++++------------------------ 1 file changed, 20 insertions(+), 29 deletions(-) diff --git a/win32ss/user/ntuser/scrollbar.c b/win32ss/user/ntuser/scrollbar.c index 6bbc7ae7bc..a1f03dfffa 100644 --- a/win32ss/user/ntuser/scrollbar.c +++ b/win32ss/user/ntuser/scrollbar.c @@ -61,9 +61,6 @@ DBG_DEFAULT_CHANNEL(UserScrollbar); BOOL APIENTRY IntEnableScrollBar(BOOL Horz, PSCROLLBARINFO Info, UINT wArrows); -static void -IntRefeshScrollInterior(PWND pWnd, INT nBar, PSCROLLBARINFO psbi); - /* Ported from WINE20020904 */ /* Compute the scroll bar rectangle, in drawing coordinates (i.e. client coords for SB_CTL, window coords for SB_VERT and @@ -640,20 +637,28 @@ co_IntSetScrollInfo(PWND Window, INT nBar, LPCSCROLLINFO lpsi, BOOL bRedraw) return lpsi->fMask & SIF_PREVIOUSPOS ? OldPos : pSBData->pos; /* SetWindowPos() already did the painting */ if (bRedraw) { - if (action & SA_SSI_REPAINT_ARROWS) - { // Redraw the entire bar. - RECTL UpdateRect = psbi->rcScrollBar; - UpdateRect.left -= Window->rcClient.left - Window->rcWindow.left; - UpdateRect.right -= Window->rcClient.left - Window->rcWindow.left; - UpdateRect.top -= Window->rcClient.top - Window->rcWindow.top; - UpdateRect.bottom -= Window->rcClient.top - Window->rcWindow.top; - co_UserRedrawWindow(Window, &UpdateRect, 0, RDW_INVALIDATE | RDW_FRAME); - } - else + RECTL UpdateRect = psbi->rcScrollBar; + UpdateRect.left -= Window->rcClient.left - Window->rcWindow.left; + UpdateRect.right -= Window->rcClient.left - Window->rcWindow.left; + UpdateRect.top -= Window->rcClient.top - Window->rcWindow.top; + UpdateRect.bottom -= Window->rcClient.top - Window->rcWindow.top; + + /* Just paint the interior and not the arrows. */ + if (!(action & SA_SSI_REPAINT_ARROWS)) { - // Redraw only the interior part of the bar. - IntRefeshScrollInterior(Window, nBar, psbi); + if (nBar == SB_HORZ) + { + UpdateRect.left += psbi->dxyLineButton; + UpdateRect.right -= psbi->dxyLineButton; + } + + if (nBar == SB_VERT) + { + UpdateRect.top += psbi->dxyLineButton; + UpdateRect.bottom -= psbi->dxyLineButton; + } } + co_UserRedrawWindow(Window, &UpdateRect, 0, RDW_INVALIDATE | RDW_FRAME); } // FIXME: Arrows /* else if( action & SA_SSI_REPAINT_ARROWS ) { @@ -1080,20 +1085,6 @@ IntScrollGetObjectId(INT SBType) return OBJID_CLIENT; } -static void -IntRefeshScrollInterior(PWND pWnd, INT nBar, PSCROLLBARINFO psbi) -{ - HDC hdc; - BOOL Vertical = ((nBar == SB_CTL) ? ((pWnd->style & SBS_VERT) != 0) : (nBar == SB_VERT)); - - hdc = UserGetDCEx(pWnd, NULL, DCX_CACHE | ((nBar == SB_CTL) ? 0 : DCX_WINDOW)); - if (hdc) - { /* Get updated info. */ - co_IntGetScrollBarInfo(pWnd, IntScrollGetObjectId(nBar), psbi); - IntDrawScrollInterior(pWnd, hdc, nBar, Vertical, psbi); - UserReleaseDC(pWnd, hdc, FALSE); - } -} void IntDrawScrollBar(PWND Wnd, HDC DC, INT Bar)