Commit 0bcadfa8 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

comctl32: Layout the toolbar after a potential resize.

parent 9d218048
...@@ -3015,38 +3015,28 @@ TOOLBAR_AddStringA (TOOLBAR_INFO *infoPtr, HINSTANCE hInstance, LPARAM lParam) ...@@ -3015,38 +3015,28 @@ TOOLBAR_AddStringA (TOOLBAR_INFO *infoPtr, HINSTANCE hInstance, LPARAM lParam)
static LRESULT static LRESULT
TOOLBAR_AutoSize (TOOLBAR_INFO *infoPtr) TOOLBAR_AutoSize (TOOLBAR_INFO *infoPtr)
{ {
RECT parent_rect;
HWND parent;
INT x, y;
INT cx, cy;
TRACE("auto sizing, style=%x!\n", infoPtr->dwStyle); TRACE("auto sizing, style=%x!\n", infoPtr->dwStyle);
TRACE("nRows: %d, infoPtr->nButtonHeight: %d\n", infoPtr->nRows, infoPtr->nButtonHeight);
parent = GetParent (infoPtr->hwndSelf); if (!(infoPtr->dwStyle & CCS_NORESIZE))
{
if (!parent || !infoPtr->bDoRedraw) RECT window_rect, parent_rect;
return 0; UINT uPosFlags = SWP_NOZORDER | SWP_NOACTIVATE;
HWND parent;
GetClientRect(parent, &parent_rect); INT x, y, cx, cy;
x = parent_rect.left; parent = GetParent (infoPtr->hwndSelf);
y = parent_rect.top;
TRACE("nRows: %d, infoPtr->nButtonHeight: %d\n", infoPtr->nRows, infoPtr->nButtonHeight); if (!parent || !infoPtr->bDoRedraw)
return 0;
cy = TOP_BORDER + infoPtr->nRows * infoPtr->nButtonHeight + BOTTOM_BORDER; GetClientRect(parent, &parent_rect);
cx = parent_rect.right - parent_rect.left;
if ((infoPtr->dwStyle & TBSTYLE_WRAPABLE) || (infoPtr->dwExStyle & TBSTYLE_EX_VERTICAL)) x = parent_rect.left;
{ y = parent_rect.top;
TOOLBAR_LayoutToolbar(infoPtr);
InvalidateRect( infoPtr->hwndSelf, NULL, TRUE );
}
if (!(infoPtr->dwStyle & CCS_NORESIZE)) cy = TOP_BORDER + infoPtr->nRows * infoPtr->nButtonHeight + BOTTOM_BORDER;
{ cx = parent_rect.right - parent_rect.left;
RECT window_rect;
UINT uPosFlags = SWP_NOZORDER | SWP_NOACTIVATE;
if ((infoPtr->dwStyle & CCS_BOTTOM) == CCS_NOMOVEY) if ((infoPtr->dwStyle & CCS_BOTTOM) == CCS_NOMOVEY)
{ {
...@@ -3075,6 +3065,12 @@ TOOLBAR_AutoSize (TOOLBAR_INFO *infoPtr) ...@@ -3075,6 +3065,12 @@ TOOLBAR_AutoSize (TOOLBAR_INFO *infoPtr)
SetWindowPos(infoPtr->hwndSelf, NULL, x, y, cx, cy, uPosFlags); SetWindowPos(infoPtr->hwndSelf, NULL, x, y, cx, cy, uPosFlags);
} }
if ((infoPtr->dwStyle & TBSTYLE_WRAPABLE) || (infoPtr->dwExStyle & TBSTYLE_EX_VERTICAL))
{
TOOLBAR_LayoutToolbar(infoPtr);
InvalidateRect( infoPtr->hwndSelf, NULL, TRUE );
}
return 0; return 0;
} }
......
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