From: Giannis Adamopoulos Date: Sat, 29 Jul 2017 09:43:48 +0000 (+0000) Subject: [UXTHEME] -Fix for the 3rd or 4th time the bug where the caption window overflows... X-Git-Tag: ReactOS-0.4.6~16 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=fd3b42b706fd5293ab614321372ef1e326854249 [UXTHEME] -Fix for the 3rd or 4th time the bug where the caption window overflows over the caption buttons which was last broken by me in 74960. CORE-13435 svn path=/trunk/; revision=75439 --- diff --git a/reactos/dll/win32/uxtheme/nonclient.c b/reactos/dll/win32/uxtheme/nonclient.c index ccf812c56d0..b4c1b96ec1d 100644 --- a/reactos/dll/win32/uxtheme/nonclient.c +++ b/reactos/dll/win32/uxtheme/nonclient.c @@ -305,6 +305,7 @@ void ThemeCalculateCaptionButtonsPos(HWND hWnd, HTHEME htheme) static void ThemeDrawCaptionButton(PDRAW_CONTEXT pcontext, + RECT* prcCurrent, CAPTIONBUTTON buttonId, INT iStateId) { @@ -348,6 +349,9 @@ ThemeDrawCaptionButton(PDRAW_CONTEXT pcontext, return; } + if (prcCurrent) + prcCurrent->right = pwndData->rcCaptionButtons[buttonId].left; + DrawThemeBackground(pcontext->theme, pcontext->hDC, iPartId, iStateId, &pwndData->rcCaptionButtons[buttonId], NULL); } @@ -369,13 +373,13 @@ static void ThemeDrawCaptionButtons(PDRAW_CONTEXT pcontext, DWORD htHot, DWORD htDown) { /* Draw the buttons */ - ThemeDrawCaptionButton(pcontext, CLOSEBUTTON, + ThemeDrawCaptionButton(pcontext, NULL, CLOSEBUTTON, ThemeGetButtonState(HTCLOSE, htHot, htDown, pcontext->Active)); - ThemeDrawCaptionButton(pcontext, MAXBUTTON, + ThemeDrawCaptionButton(pcontext, NULL, MAXBUTTON, ThemeGetButtonState(HTMAXBUTTON, htHot, htDown, pcontext->Active)); - ThemeDrawCaptionButton(pcontext, MINBUTTON, + ThemeDrawCaptionButton(pcontext, NULL, MINBUTTON, ThemeGetButtonState(HTMINBUTTON, htHot, htDown, pcontext->Active)); - ThemeDrawCaptionButton(pcontext, HELPBUTTON, + ThemeDrawCaptionButton(pcontext, NULL, HELPBUTTON, ThemeGetButtonState(HTHELP, htHot, htDown, pcontext->Active)); } @@ -421,10 +425,10 @@ ThemeDrawCaption(PDRAW_CONTEXT pcontext, RECT* prcCurrent) { iState = pcontext->Active ? BUTTON_NORMAL : BUTTON_INACTIVE; - ThemeDrawCaptionButton(pcontext, CLOSEBUTTON, iState); - ThemeDrawCaptionButton(pcontext, MAXBUTTON, iState); - ThemeDrawCaptionButton(pcontext, MINBUTTON, iState); - ThemeDrawCaptionButton(pcontext, HELPBUTTON, iState); + ThemeDrawCaptionButton(pcontext, &rcPart, CLOSEBUTTON, iState); + ThemeDrawCaptionButton(pcontext, &rcPart, MAXBUTTON, iState); + ThemeDrawCaptionButton(pcontext, &rcPart, MINBUTTON, iState); + ThemeDrawCaptionButton(pcontext, &rcPart, HELPBUTTON, iState); } rcPart.top += 3 ;