[UXTHEME] Add missing THEME_BUTTON_STATES

CORE-14245 #resolve
This commit is contained in:
Stanislav Motylkov 2018-01-23 14:05:09 +03:00 committed by Giannis Adamopoulos
parent 9e07da5ccb
commit 25564cda9d
2 changed files with 9 additions and 8 deletions

View file

@ -289,7 +289,7 @@ ThemeDrawCaptionButton(PDRAW_CONTEXT pcontext,
if (!(pcontext->wi.dwStyle & WS_MINIMIZEBOX)) if (!(pcontext->wi.dwStyle & WS_MINIMIZEBOX))
return; return;
else else
iStateId = BUTTON_DISABLED; iStateId = (pcontext->Active ? BUTTON_DISABLED : BUTTON_INACTIVE_DISABLED);
} }
iPartId = pcontext->wi.dwStyle & WS_MAXIMIZE ? WP_RESTOREBUTTON : WP_MAXBUTTON; iPartId = pcontext->wi.dwStyle & WS_MAXIMIZE ? WP_RESTOREBUTTON : WP_MAXBUTTON;
@ -301,7 +301,7 @@ ThemeDrawCaptionButton(PDRAW_CONTEXT pcontext,
if (!(pcontext->wi.dwStyle & WS_MAXIMIZEBOX)) if (!(pcontext->wi.dwStyle & WS_MAXIMIZEBOX))
return; return;
else else
iStateId = BUTTON_DISABLED; iStateId = (pcontext->Active ? BUTTON_DISABLED : BUTTON_INACTIVE_DISABLED);
} }
iPartId = pcontext->wi.dwStyle & WS_MINIMIZE ? WP_RESTOREBUTTON : WP_MINBUTTON; 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) ThemeGetButtonState(DWORD htCurrect, DWORD htHot, DWORD htDown, BOOL Active)
{ {
if (htHot == htCurrect) if (htHot == htCurrect)
return BUTTON_HOT; return (Active ? BUTTON_HOT : BUTTON_INACTIVE_HOT);
if (!Active)
return BUTTON_INACTIVE;
if (htDown == htCurrect) 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 */ /* Used only from mouse event handlers */

View file

@ -205,7 +205,10 @@ typedef enum {
BUTTON_HOT , BUTTON_HOT ,
BUTTON_PRESSED , BUTTON_PRESSED ,
BUTTON_DISABLED , BUTTON_DISABLED ,
BUTTON_INACTIVE BUTTON_INACTIVE ,
BUTTON_INACTIVE_HOT ,
BUTTON_INACTIVE_PRESSED ,
BUTTON_INACTIVE_DISABLED
} THEME_BUTTON_STATES; } THEME_BUTTON_STATES;
#define HT_ISBUTTON(ht) ((ht) == HTMINBUTTON || (ht) == HTMAXBUTTON || (ht) == HTCLOSE || (ht) == HTHELP) #define HT_ISBUTTON(ht) ((ht) == HTMINBUTTON || (ht) == HTMAXBUTTON || (ht) == HTCLOSE || (ht) == HTHELP)