Commit 85abd4c3 authored by Aled Hughes's avatar Aled Hughes Committed by Alexandre Julliard

comctl32/toolbar: Avoid unnecessary invalidation on TB_HIDEBUTTON.

parent 86b480b8
...@@ -3633,6 +3633,7 @@ static LRESULT ...@@ -3633,6 +3633,7 @@ static LRESULT
TOOLBAR_HideButton (TOOLBAR_INFO *infoPtr, INT Id, BOOL fHide) TOOLBAR_HideButton (TOOLBAR_INFO *infoPtr, INT Id, BOOL fHide)
{ {
TBUTTON_INFO *btnPtr; TBUTTON_INFO *btnPtr;
BYTE oldState;
INT nIndex; INT nIndex;
TRACE("\n"); TRACE("\n");
...@@ -3642,15 +3643,17 @@ TOOLBAR_HideButton (TOOLBAR_INFO *infoPtr, INT Id, BOOL fHide) ...@@ -3642,15 +3643,17 @@ TOOLBAR_HideButton (TOOLBAR_INFO *infoPtr, INT Id, BOOL fHide)
return FALSE; return FALSE;
btnPtr = &infoPtr->buttons[nIndex]; btnPtr = &infoPtr->buttons[nIndex];
oldState = btnPtr->fsState;
if (fHide) if (fHide)
btnPtr->fsState |= TBSTATE_HIDDEN; btnPtr->fsState |= TBSTATE_HIDDEN;
else else
btnPtr->fsState &= ~TBSTATE_HIDDEN; btnPtr->fsState &= ~TBSTATE_HIDDEN;
if (oldState != btnPtr->fsState) {
TOOLBAR_LayoutToolbar (infoPtr); TOOLBAR_LayoutToolbar (infoPtr);
InvalidateRect (infoPtr->hwndSelf, NULL, TRUE); InvalidateRect (infoPtr->hwndSelf, NULL, TRUE);
}
return TRUE; 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