[COMCTL32]
[reactos.git] / reactos / dll / win32 / comctl32 / toolbar.c
index 290b9c5..e87e2a5 100644 (file)
@@ -925,7 +925,7 @@ TOOLBAR_DrawButton (const TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr, HDC hdc,
     HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
 
     rc = btnPtr->rect;
-    CopyRect (&rcArrow, &rc);
+    rcArrow = rc;
 
     /* separator - doesn't send NM_CUSTOMDRAW */
     if (btnPtr->fsStyle & BTNS_SEP) {
@@ -979,8 +979,8 @@ TOOLBAR_DrawButton (const TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr, HDC hdc,
     /* copy text & bitmap rects after adjusting for drop-down arrow
      * so that text & bitmap is centered in the rectangle not containing
      * the arrow */
-    CopyRect(&rcText, &rc);
-    CopyRect(&rcBitmap, &rc);
+    rcText = rc;
+    rcBitmap = rc;
 
     /* Center the bitmap horizontally and vertically */
     if (dwStyle & TBSTYLE_LIST)
@@ -1007,8 +1007,7 @@ TOOLBAR_DrawButton (const TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr, HDC hdc,
     /* calculate text position */
     if (lpText)
     {
-        rcText.left += GetSystemMetrics(SM_CXEDGE);
-        rcText.right -= GetSystemMetrics(SM_CXEDGE);
+        InflateRect(&rcText, -GetSystemMetrics(SM_CXEDGE), 0);
         if (dwStyle & TBSTYLE_LIST)
         {
             rcText.left += infoPtr->nBitmapWidth + infoPtr->iListGap + 2;
@@ -1759,6 +1758,7 @@ TOOLBAR_LayoutToolbar(TOOLBAR_INFO *infoPtr)
        if (btnPtr->fsState & TBSTATE_HIDDEN)
        {
            SetRectEmpty (&btnPtr->rect);
+           TOOLBAR_TooltipSetRect(infoPtr, btnPtr);
            continue;
        }
 
@@ -2734,9 +2734,9 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
                           lpdis->rcItem.right, lpdis->rcItem.bottom);
 
                /* calculate button and text rectangles */
-               CopyRect (&rcButton, &lpdis->rcItem);
+                rcButton = lpdis->rcItem;
                InflateRect (&rcButton, -1, -1);
-               CopyRect (&rcText, &rcButton);
+                rcText = rcButton;
                rcButton.right = rcButton.left + custInfo->tbInfo->nBitmapWidth + 6;
                rcText.left = rcButton.right + 2;
 
@@ -5704,7 +5704,7 @@ TOOLBAR_LButtonDown (TOOLBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
             RECT arrowRect;
             infoPtr->nOldHit = nHit;
 
-            CopyRect(&arrowRect, &btnPtr->rect);
+            arrowRect = btnPtr->rect;
             arrowRect.left = max(btnPtr->rect.left, btnPtr->rect.right - DDARROW_WIDTH);
 
             /* for EX_DRAWDDARROWS style,  click must be in the drop-down arrow rect */