[RSHELL][COMCTL32] Fix wrong selected item color used by the Start Menu. Brought...
authorAmine Khaldi <amine.khaldi@reactos.org>
Fri, 24 Apr 2015 14:12:24 +0000 (14:12 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Fri, 24 Apr 2015 14:12:24 +0000 (14:12 +0000)
svn path=/trunk/; revision=67380

reactos/base/shell/rshell/CMenuToolbars.cpp
reactos/dll/win32/comctl32/toolbar.c

index cb6509e..d762a7f 100644 (file)
@@ -21,6 +21,7 @@
 #include <commoncontrols.h>
 #include <shlwapi_undoc.h>
 #include <uxtheme.h>
+#include <vssym32.h>
 
 #include "CMenuBand.h"
 #include "CMenuToolbars.h"
@@ -159,7 +160,7 @@ HRESULT CMenuToolbarBase::OnCustomDraw(LPNMTBCUSTOMDRAW cdraw, LRESULT * theResu
         isHot = m_hotBar == this && (int) cdraw->nmcd.dwItemSpec == m_hotItem;
         isPopup = m_popupBar == this && (int) cdraw->nmcd.dwItemSpec == m_popupItem;
 
-        if (m_initFlags & SMINIT_VERTICAL || IsAppThemed())
+        if ((m_initFlags & SMINIT_VERTICAL))
         {
             COLORREF clrText;
             HBRUSH   bgBrush;
@@ -295,7 +296,10 @@ HRESULT CMenuToolbarBase::ShowDW(BOOL fShow)
     UpdateImageLists();
 
     // For custom-drawing
-    SystemParametersInfo(SPI_GETFLATMENU, 0, &m_useFlatMenus, 0);
+    if (IsAppThemed())
+        GetThemeSysBool(GetWindowTheme(m_hWnd), TMT_FLATMENUS);
+    else
+        SystemParametersInfo(SPI_GETFLATMENU, 0, &m_useFlatMenus, 0);
 
     return S_OK;
 }
@@ -383,7 +387,11 @@ HRESULT CMenuToolbarBase::CreateToolbar(HWND hwndParent, DWORD dwFlags)
 
     SetWindowTheme(m_hWnd, L"", L"");
 
-    SystemParametersInfo(SPI_GETFLATMENU, 0, &m_useFlatMenus, 0);
+    if (IsAppThemed())
+        GetThemeSysBool(GetWindowTheme(m_hWnd), TMT_FLATMENUS);
+    else
+        SystemParametersInfo(SPI_GETFLATMENU, 0, &m_useFlatMenus, 0);
+
     m_menuBand->AdjustForTheme(m_useFlatMenus);
 
     // If needed, create the pager.
index 549d43a..e13c90b 100644 (file)
@@ -1042,7 +1042,11 @@ TOOLBAR_DrawButton (const TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr, HDC hdc,
         }
     }
 
+#ifdef __REACTOS__
+    if (theme && !(dwItemCDFlag & TBCDRF_NOBACKGROUND))
+#else
     if (theme)
+#endif
     {
         int partId = drawSepDropDownArrow ? TP_SPLITBUTTON : TP_BUTTON;
         int stateId = TS_NORMAL;
@@ -1059,7 +1063,12 @@ TOOLBAR_DrawButton (const TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr, HDC hdc,
             
         DrawThemeBackground (theme, hdc, partId, stateId, &rc, NULL);
     }
+
+#ifdef __REACTOS__
+    if (!theme)
+#else
     else
+#endif
         TOOLBAR_DrawFrame(infoPtr, &tbcd, &rc, dwItemCDFlag);
 
     if (drawSepDropDownArrow)