Commit 951b0a22 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

Only redraw button in PressButton and Indeterminate if its state has

changed.
parent 9591679b
......@@ -3551,17 +3551,20 @@ TOOLBAR_Indeterminate (HWND hwnd, WPARAM wParam, LPARAM lParam)
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
TBUTTON_INFO *btnPtr;
INT nIndex;
DWORD oldState;
nIndex = TOOLBAR_GetButtonIndex (infoPtr, (INT)wParam, FALSE);
if (nIndex == -1)
return FALSE;
btnPtr = &infoPtr->buttons[nIndex];
oldState = btnPtr->fsState;
if (LOWORD(lParam) == FALSE)
btnPtr->fsState &= ~TBSTATE_INDETERMINATE;
else
btnPtr->fsState |= TBSTATE_INDETERMINATE;
if(oldState != btnPtr->fsState)
InvalidateRect(hwnd, &btnPtr->rect, TOOLBAR_HasText(infoPtr, btnPtr));
return TRUE;
......@@ -3867,17 +3870,20 @@ TOOLBAR_PressButton (HWND hwnd, WPARAM wParam, LPARAM lParam)
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
TBUTTON_INFO *btnPtr;
INT nIndex;
DWORD oldState;
nIndex = TOOLBAR_GetButtonIndex (infoPtr, (INT)wParam, FALSE);
if (nIndex == -1)
return FALSE;
btnPtr = &infoPtr->buttons[nIndex];
oldState = btnPtr->fsState;
if (LOWORD(lParam) == FALSE)
btnPtr->fsState &= ~TBSTATE_PRESSED;
else
btnPtr->fsState |= TBSTATE_PRESSED;
if(oldState != btnPtr->fsState)
InvalidateRect(hwnd, &btnPtr->rect, TOOLBAR_HasText(infoPtr, btnPtr));
return TRUE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment