From f1421e61ad1296b39697c8194024366cd6b9acec Mon Sep 17 00:00:00 2001 From: Giannis Adamopoulos Date: Tue, 28 Mar 2017 21:31:16 +0000 Subject: [PATCH] [UXTHEME] -Slightly improve the width of the caption buttons by scaling it based on the height of the caption buttons. CORE-6000 svn path=/trunk/; revision=74240 --- reactos/dll/win32/uxtheme/nonclient.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/reactos/dll/win32/uxtheme/nonclient.c b/reactos/dll/win32/uxtheme/nonclient.c index 89c50f8a356..aa379032831 100644 --- a/reactos/dll/win32/uxtheme/nonclient.c +++ b/reactos/dll/win32/uxtheme/nonclient.c @@ -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;