[UXTHEME] -Slightly improve the width of the caption buttons by scaling it based...
authorGiannis Adamopoulos <gadamopoulos@reactos.org>
Tue, 28 Mar 2017 21:31:16 +0000 (21:31 +0000)
committerGiannis Adamopoulos <gadamopoulos@reactos.org>
Tue, 28 Mar 2017 21:31:16 +0000 (21:31 +0000)
svn path=/trunk/; revision=74240

reactos/dll/win32/uxtheme/nonclient.c

index 89c50f8..aa37903 100644 (file)
@@ -216,9 +216,7 @@ ThemeDrawCaptionButton(PDRAW_CONTEXT pcontext,
 {
     RECT rcPart;
     INT ButtonWidth, ButtonHeight, iPartId;
-    
-    ButtonHeight = GetSystemMetrics( pcontext->wi.dwExStyle & WS_EX_TOOLWINDOW ? SM_CYSMSIZE : SM_CYSIZE);
-    ButtonWidth = GetSystemMetrics( pcontext->wi.dwExStyle & WS_EX_TOOLWINDOW ? SM_CXSMSIZE : SM_CXSIZE);
+    SIZE ButtonSize;
 
     switch(buttonId)
     {
@@ -255,6 +253,11 @@ ThemeDrawCaptionButton(PDRAW_CONTEXT pcontext,
         return;
     }
 
+    GetThemePartSize(pcontext->theme, pcontext->hDC, iPartId, 0, NULL, TS_MIN, &ButtonSize);
+
+    ButtonHeight = GetSystemMetrics( pcontext->wi.dwExStyle & WS_EX_TOOLWINDOW ? SM_CYSMSIZE : SM_CYSIZE);
+    ButtonWidth = MulDiv(ButtonSize.cx, ButtonHeight, ButtonSize.cy);
+
     ButtonHeight -= 4;
     ButtonWidth -= 4;