[COMCTL32] -Buttons with the BS_PUSHLIKE style are drawn as if they were BS_PUSHBUTTO...
authorGiannis Adamopoulos <gadamopoulos@reactos.org>
Mon, 6 Mar 2017 21:57:10 +0000 (21:57 +0000)
committerGiannis Adamopoulos <gadamopoulos@reactos.org>
Mon, 6 Mar 2017 21:57:10 +0000 (21:57 +0000)
svn path=/trunk/; revision=74120

reactos/dll/win32/comctl32/theme_button.c

index 4fd38d6..daeedc9 100644 (file)
@@ -335,13 +335,19 @@ BOOL BUTTON_PaintWithTheme(HTHEME theme, HWND hwnd, HDC hParamDC, LPARAM prfFlag
 {
     DWORD dwStyle;
     DWORD dwStyleEx;
+    DWORD type;
     UINT dtFlags;
     int state;
     ButtonState drawState;
     pfThemedPaint paint;
 
     dwStyle = GetWindowLongW(hwnd, GWL_STYLE);
-    paint = btnThemedPaintFunc[ dwStyle & BUTTON_TYPE ];
+    type = dwStyle & BUTTON_TYPE;
+
+    if (type != BS_PUSHBUTTON && type != BS_DEFPUSHBUTTON && (dwStyle & BS_PUSHLIKE))
+        type = BS_PUSHBUTTON;
+
+    paint = btnThemedPaintFunc[type];
     if (!paint)
         return FALSE;
 
@@ -361,7 +367,7 @@ BOOL BUTTON_PaintWithTheme(HTHEME theme, HWND hwnd, HDC hParamDC, LPARAM prfFlag
     }
     else drawState = STATE_DISABLED;
 
-    if (drawState == STATE_NORMAL && (dwStyle & BUTTON_TYPE) == BS_DEFPUSHBUTTON)
+    if (drawState == STATE_NORMAL && type == BS_DEFPUSHBUTTON)
     {
         drawState = STATE_DEFAULTED;
     }