Reduce toolbar redrawing and flicker by calling RedrawWindow() in
TOOLBAR_MouseMove() only if hot effect applies to the current hot button. Restore bHot flag of hot button in TOOLBAR_LButtonUp() to restore hot effect properly.
This commit is contained in:
parent
7f90a8c900
commit
7030c5f78a
|
@ -3159,6 +3159,10 @@ TOOLBAR_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
pt.y = (INT)HIWORD(lParam);
|
||||
nHit = TOOLBAR_InternalHitTest (hwnd, &pt);
|
||||
|
||||
/* restore hot effect to hot button disabled by TOOLBAR_LButtonDown() */
|
||||
if(infoPtr->nHotItem >= 0)
|
||||
infoPtr->buttons[infoPtr->nHotItem].bHot = TRUE;
|
||||
|
||||
if ((infoPtr->bCaptured) && (infoPtr->nButtonDown >= 0)) {
|
||||
infoPtr->bCaptured = FALSE;
|
||||
ReleaseCapture ();
|
||||
|
@ -3317,10 +3321,14 @@ TOOLBAR_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
btnPtr = &infoPtr->buttons[nHit];
|
||||
btnPtr->bHot = TRUE;
|
||||
|
||||
RedrawWindow(hwnd,&btnPtr->rect,NULL,
|
||||
RDW_ERASE|RDW_INVALIDATE|RDW_UPDATENOW);
|
||||
|
||||
infoPtr->nHotItem = nHit;
|
||||
|
||||
/* only enabled buttons show hot effect */
|
||||
if(infoPtr->buttons[nHit].fsState & TBSTATE_ENABLED)
|
||||
{
|
||||
RedrawWindow(hwnd,&btnPtr->rect,NULL,
|
||||
RDW_ERASE|RDW_INVALIDATE|RDW_UPDATENOW);
|
||||
}
|
||||
}
|
||||
|
||||
if (infoPtr->bCaptured) {
|
||||
|
|
Loading…
Reference in New Issue