[UXTHEME] -Draw the background glyph inside the content margins. CORE-6000
authorGiannis Adamopoulos <gadamopoulos@reactos.org>
Wed, 29 Mar 2017 10:01:00 +0000 (10:01 +0000)
committerGiannis Adamopoulos <gadamopoulos@reactos.org>
Wed, 29 Mar 2017 10:01:00 +0000 (10:01 +0000)
svn path=/trunk/; revision=74241

reactos/dll/win32/uxtheme/draw.c

index a4064b0..6bcf0b0 100644 (file)
@@ -1051,7 +1051,19 @@ HRESULT WINAPI DrawThemeBackgroundEx(HTHEME hTheme, HDC hdc, int iPartId,
         hr = E_FAIL;
     }
     if(SUCCEEDED(hr))
-        hr = UXTHEME_DrawGlyph(hTheme, hdc, iPartId, iStateId, &rt, opts);
+    {
+        RECT rcGlyph = *pRect;
+        MARGINS margin;
+        hr = GetThemeMargins(hTheme, hdc, iPartId, iStateId, TMT_CONTENTMARGINS, NULL, &margin);
+        if(SUCCEEDED(hr))
+        {
+            rcGlyph.left += margin.cxLeftWidth;
+            rcGlyph.right -= margin.cxRightWidth;
+            rcGlyph.top += margin.cyTopHeight;
+            rcGlyph.bottom -= margin.cyBottomHeight;
+        }
+        hr = UXTHEME_DrawGlyph(hTheme, hdc, iPartId, iStateId, &rcGlyph, opts);
+    }
     if(opts->dwFlags & DTBG_CLIPRECT) {
         if(hasClip == 0)
             SelectClipRgn(hdc, NULL);