german translation update
[reactos.git] / reactos / dll / win32 / user32 / windows / nonclient.c
index 3849cb5..b797bda 100644 (file)
@@ -1149,8 +1149,8 @@ DrawCaption(HWND hWnd, HDC hDC, LPCRECT lprc, UINT uFlags)
     {
         if (uFlags & DC_GRADIENT)
         {
-          static GRADIENT_RECT gcap = {0, 1};
-          TRIVERTEX vert[2];
+          static GRADIENT_RECT gcap [] = {{0, 1}, {2, 3}};
+                 TRIVERTEX vert[4];
           COLORREF Colors[2];
           LONG xx;
 
@@ -1160,36 +1160,22 @@ DrawCaption(HWND hWnd, HDC hDC, LPCRECT lprc, UINT uFlags)
           else
             ButtonWidth = GetSystemMetrics(SM_CXSIZE) - 2;
 
-          if (Style & WS_SYSMENU)
-          {
-            r.right -= 3 + ButtonWidth;
-            if (! (uFlags & DC_SMALLCAP))
-            {
-              if(Style & (WS_MAXIMIZEBOX | WS_MINIMIZEBOX))
-                r.right -= 2 + 2 * ButtonWidth;
-              else
-                r.right -= 2;
-              r.right -= 2;
-            }
-          }
+          //if (Style & WS_SYSMENU)
+          //{
+          //  r.right -= 3 + ButtonWidth;
+          //  if (! (uFlags & DC_SMALLCAP))
+          //  {
+          //    if(Style & (WS_MAXIMIZEBOX | WS_MINIMIZEBOX))
+          //      r.right -= 2 + 2 * ButtonWidth;
+          //    else
+          //      r.right -= 2;
+          //    r.right -= 2;
+          //  }
+          //}
 
           Colors[0] = GetSysColor((uFlags & DC_ACTIVE) ? COLOR_ACTIVECAPTION : COLOR_INACTIVECAPTION);
           Colors[1] = GetSysColor((uFlags & DC_ACTIVE) ? COLOR_GRADIENTACTIVECAPTION : COLOR_GRADIENTINACTIVECAPTION);
 
-          if ((uFlags & DC_ICON) && (Style & WS_SYSMENU) && !(uFlags & DC_SMALLCAP))
-          {
-            OldBrush = SelectObject(MemDC, GetSysColorBrush(uFlags & DC_ACTIVE ? COLOR_ACTIVECAPTION : COLOR_INACTIVECAPTION));
-            if (!OldBrush) goto cleanup;
-            xx = GetSystemMetrics(SM_CXSIZE) + Padding;
-            /* draw icon background */
-            PatBlt(MemDC, 0, 0, xx, lprc->bottom - lprc->top, PATCOPY);
-            /* For some reason the icon isn't centered correctly... */
-            r.top --;
-            if (UserDrawSysMenuButton(hWnd, MemDC, &r, FALSE))
-              r.left += xx;
-            r.top ++;
-          }
-
           vert[0].x = r.left;
           vert[0].y = 0;
           vert[0].Red = GetRValue(Colors[0]) << 8;
@@ -1198,26 +1184,50 @@ DrawCaption(HWND hWnd, HDC hDC, LPCRECT lprc, UINT uFlags)
           vert[0].Alpha = 0;
 
           vert[1].x = r.right;
-          vert[1].y = lprc->bottom - lprc->top;
+          vert[1].y = (lprc->bottom - lprc->top) >> 1;
           vert[1].Red = GetRValue(Colors[1]) << 8;
           vert[1].Green = GetGValue(Colors[1]) << 8;
           vert[1].Blue = GetBValue(Colors[1]) << 8;
           vert[1].Alpha = 0;
 
-          GdiGradientFill(MemDC, vert, 2, &gcap, 1, GRADIENT_FILL_RECT_H);
+          vert[2].x = r.left;
+          vert[2].y = (lprc->bottom - lprc->top) >> 1;
+          vert[2].Red = GetRValue(Colors[1]) << 8;
+          vert[2].Green = GetGValue(Colors[1]) << 8;
+          vert[2].Blue = GetBValue(Colors[1]) << 8;
+          vert[2].Alpha = 0;
+
+          vert[3].x = r.right;
+          vert[3].y = (lprc->bottom - lprc->top);
+          vert[3].Red = GetRValue(Colors[0]) << 8;
+          vert[3].Green = GetGValue(Colors[0]) << 8;
+          vert[3].Blue = GetBValue(Colors[0]) << 8;
+          vert[3].Alpha = 0;
+
+          GdiGradientFill(MemDC, vert, 4, &gcap, 2, GRADIENT_FILL_RECT_V);
+
+          if ((uFlags & DC_ICON) && (Style & WS_SYSMENU) && !(uFlags & DC_SMALLCAP))
+          {
+            r.top --;
+                       SetBkMode( MemDC, TRANSPARENT );
+                       xx = GetSystemMetrics(SM_CXSIZE) + Padding;
+            if (UserDrawSysMenuButton(hWnd, MemDC, &r, FALSE))
+              r.left += xx;
+            r.top ++;
+          }
 
           if(OldBrush)
           {
             SelectObject(MemDC, OldBrush);
             OldBrush = NULL;
           }
-          xx = lprc->right - lprc->left - r.right;
-          if(xx > 0)
-          {
-            OldBrush = SelectObject(MemDC, GetSysColorBrush(uFlags & DC_ACTIVE ? COLOR_GRADIENTACTIVECAPTION : COLOR_GRADIENTINACTIVECAPTION));
-            if (!OldBrush) goto cleanup;
-            PatBlt(MemDC, r.right, 0, xx, lprc->bottom - lprc->top, PATCOPY);
-          }
+          //xx = lprc->right - lprc->left - r.right;
+          //if(xx > 0)
+          //{
+          //  OldBrush = SelectObject(MemDC, GetSysColorBrush(uFlags & DC_ACTIVE ? COLOR_GRADIENTACTIVECAPTION : COLOR_GRADIENTINACTIVECAPTION));
+          //  if (!OldBrush) goto cleanup;
+          //  PatBlt(MemDC, r.right, 0, xx, lprc->bottom - lprc->top, PATCOPY);
+          //}
         }
         else
         {