[UXTHEME] -When calculating the size of caption buttons assume that they have the same size. Hacks in the theme files that change the way the buttons are drawn actually make them appear to have a different size. CORE-13512

svn path=/trunk/; revision=75696
This commit is contained in:
Giannis Adamopoulos 2017-08-28 13:41:16 +00:00
parent 8fe63e68c5
commit f6de9ccb3d

View file

@ -217,6 +217,7 @@ void ThemeCalculateCaptionButtonsPos(HWND hWnd, HTHEME htheme)
INT ButtonWidth, ButtonHeight, iPartId, i;
WINDOWINFO wi = {sizeof(wi)};
RECT rcCurrent;
SIZE ButtonSize;
/* First of all check if we have something to do here */
style = GetWindowLongW(hWnd, GWL_STYLE);
@ -243,27 +244,7 @@ void ThemeCalculateCaptionButtonsPos(HWND hWnd, HTHEME htheme)
InflateRect(&rcCurrent, -(int)wi.cyWindowBorders-BUTTON_GAP_SIZE,
-(int)wi.cyWindowBorders-BUTTON_GAP_SIZE);
for (i = CLOSEBUTTON; i <= HELPBUTTON; i++)
{
SIZE ButtonSize;
switch(i)
{
case CLOSEBUTTON:
iPartId = wi.dwExStyle & WS_EX_TOOLWINDOW ? WP_SMALLCLOSEBUTTON : WP_CLOSEBUTTON;
break;
case MAXBUTTON:
iPartId = wi.dwStyle & WS_MAXIMIZE ? WP_RESTOREBUTTON : WP_MAXBUTTON;
break;
case MINBUTTON:
iPartId = wi.dwStyle & WS_MINIMIZE ? WP_RESTOREBUTTON : WP_MINBUTTON;
break;
default:
iPartId = WP_HELPBUTTON ;
}
GetThemePartSize(htheme, NULL, iPartId, 0, NULL, TS_MIN, &ButtonSize);
@ -273,6 +254,8 @@ void ThemeCalculateCaptionButtonsPos(HWND hWnd, HTHEME htheme)
ButtonHeight -= 4;
ButtonWidth -= 4;
for (i = CLOSEBUTTON; i <= HELPBUTTON; i++)
{
SetRect(&pwndData->rcCaptionButtons[i],
rcCurrent.right - ButtonWidth,
rcCurrent.top,