Author: akhaldi Date: Fri Apr 24 14:12:24 2015 New Revision: 67380
URL: http://svn.reactos.org/svn/reactos?rev=67380&view=rev Log: [RSHELL][COMCTL32] Fix wrong selected item color used by the Start Menu. Brought to you by Stefano Toncich with minor changes by me. CORE-9309
Modified: trunk/reactos/base/shell/rshell/CMenuToolbars.cpp trunk/reactos/dll/win32/comctl32/toolbar.c
Modified: trunk/reactos/base/shell/rshell/CMenuToolbars.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/rshell/CMenuTool... ============================================================================== --- trunk/reactos/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1] (original) +++ trunk/reactos/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1] Fri Apr 24 14:12:24 2015 @@ -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 @@ 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 @@ 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 @@
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.
Modified: trunk/reactos/dll/win32/comctl32/toolbar.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/toolbar.... ============================================================================== --- trunk/reactos/dll/win32/comctl32/toolbar.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/toolbar.c [iso-8859-1] Fri Apr 24 14:12:24 2015 @@ -1042,7 +1042,11 @@ } }
+#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 @@
DrawThemeBackground (theme, hdc, partId, stateId, &rc, NULL); } + +#ifdef __REACTOS__ + if (!theme) +#else else +#endif TOOLBAR_DrawFrame(infoPtr, &tbcd, &rc, dwItemCDFlag);
if (drawSepDropDownArrow)