From: Stanislav Motylkov Date: Tue, 23 Jan 2018 11:05:09 +0000 (+0300) Subject: [UXTHEME] Add missing THEME_BUTTON_STATES X-Git-Tag: 0.4.9-dev~231 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=25564cda9d2389595ddf3fc65214824b380d5d46 [UXTHEME] Add missing THEME_BUTTON_STATES CORE-14245 #resolve --- diff --git a/dll/win32/uxtheme/nonclient.c b/dll/win32/uxtheme/nonclient.c index fb40624fcbb..b777d02e418 100644 --- a/dll/win32/uxtheme/nonclient.c +++ b/dll/win32/uxtheme/nonclient.c @@ -289,7 +289,7 @@ ThemeDrawCaptionButton(PDRAW_CONTEXT pcontext, if (!(pcontext->wi.dwStyle & WS_MINIMIZEBOX)) return; else - iStateId = BUTTON_DISABLED; + iStateId = (pcontext->Active ? BUTTON_DISABLED : BUTTON_INACTIVE_DISABLED); } iPartId = pcontext->wi.dwStyle & WS_MAXIMIZE ? WP_RESTOREBUTTON : WP_MAXBUTTON; @@ -301,7 +301,7 @@ ThemeDrawCaptionButton(PDRAW_CONTEXT pcontext, if (!(pcontext->wi.dwStyle & WS_MAXIMIZEBOX)) return; else - iStateId = BUTTON_DISABLED; + iStateId = (pcontext->Active ? BUTTON_DISABLED : BUTTON_INACTIVE_DISABLED); } iPartId = pcontext->wi.dwStyle & WS_MINIMIZE ? WP_RESTOREBUTTON : WP_MINBUTTON; @@ -322,13 +322,11 @@ static DWORD ThemeGetButtonState(DWORD htCurrect, DWORD htHot, DWORD htDown, BOOL Active) { if (htHot == htCurrect) - return BUTTON_HOT; - if (!Active) - return BUTTON_INACTIVE; + return (Active ? BUTTON_HOT : BUTTON_INACTIVE_HOT); if (htDown == htCurrect) - return BUTTON_PRESSED; + return (Active ? BUTTON_PRESSED : BUTTON_INACTIVE_PRESSED); - return BUTTON_NORMAL; + return (Active ? BUTTON_NORMAL : BUTTON_INACTIVE); } /* Used only from mouse event handlers */ diff --git a/dll/win32/uxtheme/uxthemep.h b/dll/win32/uxtheme/uxthemep.h index 2708cdd48f8..31e50566b96 100644 --- a/dll/win32/uxtheme/uxthemep.h +++ b/dll/win32/uxtheme/uxthemep.h @@ -205,7 +205,10 @@ typedef enum { BUTTON_HOT , BUTTON_PRESSED , BUTTON_DISABLED , - BUTTON_INACTIVE + BUTTON_INACTIVE , + BUTTON_INACTIVE_HOT , + BUTTON_INACTIVE_PRESSED , + BUTTON_INACTIVE_DISABLED } THEME_BUTTON_STATES; #define HT_ISBUTTON(ht) ((ht) == HTMINBUTTON || (ht) == HTMAXBUTTON || (ht) == HTCLOSE || (ht) == HTHELP)