Huw Davies : comctl32: Layout the toolbar after a potential resize.

Alexandre Julliard julliard at wine.codeweavers.com
Tue May 19 09:53:21 CDT 2015


Module: wine
Branch: master
Commit: 0bcadfa88f7da527150d5d1040e2e6c65b3aba31
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=0bcadfa88f7da527150d5d1040e2e6c65b3aba31

Author: Huw Davies <huw at codeweavers.com>
Date:   Tue May 19 12:51:55 2015 +0100

comctl32: Layout the toolbar after a potential resize.

---

 dlls/comctl32/toolbar.c | 46 +++++++++++++++++++++-------------------------
 1 file changed, 21 insertions(+), 25 deletions(-)

diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c
index 54a31ac..97d509e 100644
--- a/dlls/comctl32/toolbar.c
+++ b/dlls/comctl32/toolbar.c
@@ -3015,38 +3015,28 @@ TOOLBAR_AddStringA (TOOLBAR_INFO *infoPtr, HINSTANCE hInstance, LPARAM lParam)
 static LRESULT
 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("nRows: %d, infoPtr->nButtonHeight: %d\n", infoPtr->nRows, infoPtr->nButtonHeight);
 
-    parent = GetParent (infoPtr->hwndSelf);
-
-    if (!parent || !infoPtr->bDoRedraw)
-        return 0;
-
-    GetClientRect(parent, &parent_rect);
+    if (!(infoPtr->dwStyle & CCS_NORESIZE))
+    {
+        RECT window_rect, parent_rect;
+        UINT uPosFlags = SWP_NOZORDER | SWP_NOACTIVATE;
+        HWND parent;
+        INT  x, y, cx, cy;
 
-    x = parent_rect.left;
-    y = parent_rect.top;
+        parent = GetParent (infoPtr->hwndSelf);
 
-    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;
-    cx = parent_rect.right - parent_rect.left;
+        GetClientRect(parent, &parent_rect);
 
-    if ((infoPtr->dwStyle & TBSTYLE_WRAPABLE) || (infoPtr->dwExStyle & TBSTYLE_EX_VERTICAL))
-    {
-        TOOLBAR_LayoutToolbar(infoPtr);
-        InvalidateRect( infoPtr->hwndSelf, NULL, TRUE );
-    }
+        x = parent_rect.left;
+        y = parent_rect.top;
 
-    if (!(infoPtr->dwStyle & CCS_NORESIZE))
-    {
-        RECT window_rect;
-        UINT uPosFlags = SWP_NOZORDER | SWP_NOACTIVATE;
+        cy = TOP_BORDER + infoPtr->nRows * infoPtr->nButtonHeight + BOTTOM_BORDER;
+        cx = parent_rect.right - parent_rect.left;
 
         if ((infoPtr->dwStyle & CCS_BOTTOM) == CCS_NOMOVEY)
         {
@@ -3075,6 +3065,12 @@ TOOLBAR_AutoSize (TOOLBAR_INFO *infoPtr)
         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;
 }
 




More information about the wine-cvs mailing list