[UXTHEME] Add missing THEME_BUTTON_STATES
authorStanislav Motylkov <x86corez@gmail.com>
Tue, 23 Jan 2018 11:05:09 +0000 (14:05 +0300)
committerGiannis Adamopoulos <gadamopoulos@reactos.org>
Tue, 23 Jan 2018 12:46:57 +0000 (14:46 +0200)
CORE-14245 #resolve

dll/win32/uxtheme/nonclient.c
dll/win32/uxtheme/uxthemep.h

index fb40624..b777d02 100644 (file)
@@ -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 */
index 2708cdd..31e5056 100644 (file)
@@ -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)