Commit 60e305d9 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

comctl32: Invalidate the toolbar if the button size is changed.

parent 5b7b911f
...@@ -4364,6 +4364,7 @@ static LRESULT ...@@ -4364,6 +4364,7 @@ static LRESULT
TOOLBAR_SetButtonSize (TOOLBAR_INFO *infoPtr, LPARAM lParam) TOOLBAR_SetButtonSize (TOOLBAR_INFO *infoPtr, LPARAM lParam)
{ {
INT cx = (short)LOWORD(lParam), cy = (short)HIWORD(lParam); INT cx = (short)LOWORD(lParam), cy = (short)HIWORD(lParam);
int top = default_top_margin(infoPtr);
if ((cx < 0) || (cy < 0)) if ((cx < 0) || (cy < 0))
{ {
...@@ -4386,15 +4387,20 @@ TOOLBAR_SetButtonSize (TOOLBAR_INFO *infoPtr, LPARAM lParam) ...@@ -4386,15 +4387,20 @@ TOOLBAR_SetButtonSize (TOOLBAR_INFO *infoPtr, LPARAM lParam)
*/ */
if (cx == 0) cx = 24; if (cx == 0) cx = 24;
if (cy == 0) cy = 22; if (cy == 0) cy = 22;
cx = max(cx, infoPtr->szPadding.cx + infoPtr->nBitmapWidth); cx = max(cx, infoPtr->szPadding.cx + infoPtr->nBitmapWidth);
cy = max(cy, infoPtr->szPadding.cy + infoPtr->nBitmapHeight); cy = max(cy, infoPtr->szPadding.cy + infoPtr->nBitmapHeight);
infoPtr->nButtonWidth = cx; if (cx != infoPtr->nButtonWidth || cy != infoPtr->nButtonHeight ||
infoPtr->nButtonHeight = cy; top != infoPtr->iTopMargin)
{
infoPtr->iTopMargin = default_top_margin(infoPtr); infoPtr->nButtonWidth = cx;
TOOLBAR_LayoutToolbar(infoPtr); infoPtr->nButtonHeight = cy;
infoPtr->iTopMargin = top;
TOOLBAR_LayoutToolbar( infoPtr );
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