[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

svn path=/trunk/; revision=67380
This commit is contained in:
Amine Khaldi 2015-04-24 14:12:24 +00:00
parent 91017f0f9a
commit 1fae599114
2 changed files with 20 additions and 3 deletions

View 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.

View 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)