https://git.reactos.org/?p=reactos.git;a=commitdiff;h=25564cda9d2389595ddf3…
commit 25564cda9d2389595ddf3fc65214824b380d5d46
Author: Stanislav Motylkov <x86corez(a)gmail.com>
AuthorDate: Tue Jan 23 14:05:09 2018 +0300
Commit: Giannis Adamopoulos <gadamopoulos(a)reactos.org>
CommitDate: Tue Jan 23 14:46:57 2018 +0200
[UXTHEME] Add missing THEME_BUTTON_STATES
CORE-14245 #resolve
---
dll/win32/uxtheme/nonclient.c | 12 +++++-------
dll/win32/uxtheme/uxthemep.h | 5 ++++-
2 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/dll/win32/uxtheme/nonclient.c b/dll/win32/uxtheme/nonclient.c
index fb40624fcb..b777d02e41 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 2708cdd48f..31e50566b9 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)