mirror of
https://github.com/reactos/reactos.git
synced 2025-06-23 05:20:18 +00:00
[RSHELL]
* CMenuBand: Fix menu colors. CORE-7881 svn path=/branches/shell-experiments/; revision=62320
This commit is contained in:
parent
b62a6757ee
commit
9cf711a73f
1 changed files with 19 additions and 12 deletions
|
@ -610,6 +610,16 @@ HRESULT STDMETHODCALLTYPE CMenuBand::OnWinEvent(HWND hWnd, UINT uMsg, WPARAM wPa
|
||||||
HDC hdc;
|
HDC hdc;
|
||||||
HBRUSH bgBrush;
|
HBRUSH bgBrush;
|
||||||
HBRUSH hotBrush;
|
HBRUSH hotBrush;
|
||||||
|
NMHDR * hdr;
|
||||||
|
NMTBCUSTOMDRAW * cdraw;
|
||||||
|
NMTBHOTITEM * hot;
|
||||||
|
NMMOUSE * rclick;
|
||||||
|
NMPGCALCSIZE* csize;
|
||||||
|
TBBUTTONINFO btni;
|
||||||
|
BOOL useFlatMenus = FALSE;
|
||||||
|
COLORREF clrText;
|
||||||
|
COLORREF clrTextHighlight;
|
||||||
|
|
||||||
|
|
||||||
*theResult = 0;
|
*theResult = 0;
|
||||||
switch (uMsg)
|
switch (uMsg)
|
||||||
|
@ -629,12 +639,7 @@ HRESULT STDMETHODCALLTYPE CMenuBand::OnWinEvent(HWND hWnd, UINT uMsg, WPARAM wPa
|
||||||
return S_OK;
|
return S_OK;
|
||||||
|
|
||||||
case WM_NOTIFY:
|
case WM_NOTIFY:
|
||||||
NMHDR * hdr = reinterpret_cast<LPNMHDR>(lParam);
|
hdr = reinterpret_cast<LPNMHDR>(lParam);
|
||||||
NMTBCUSTOMDRAW * cdraw;
|
|
||||||
NMTBHOTITEM * hot;
|
|
||||||
NMMOUSE * rclick;
|
|
||||||
NMPGCALCSIZE* csize;
|
|
||||||
TBBUTTONINFO btni;
|
|
||||||
switch (hdr->code)
|
switch (hdr->code)
|
||||||
{
|
{
|
||||||
case PGN_CALCSIZE:
|
case PGN_CALCSIZE:
|
||||||
|
@ -725,15 +730,13 @@ HRESULT STDMETHODCALLTYPE CMenuBand::OnWinEvent(HWND hWnd, UINT uMsg, WPARAM wPa
|
||||||
|
|
||||||
case CDDS_ITEMPREPAINT:
|
case CDDS_ITEMPREPAINT:
|
||||||
|
|
||||||
cdraw->clrBtnFace = GetSysColor(COLOR_MENU);
|
SystemParametersInfo(SPI_GETFLATMENU, 0, &useFlatMenus, 0);
|
||||||
cdraw->clrBtnHighlight = GetSysColor(COLOR_MENUHILIGHT);
|
|
||||||
|
|
||||||
cdraw->clrText = GetSysColor(COLOR_MENUTEXT);
|
clrText = GetSysColor(COLOR_MENUTEXT);
|
||||||
cdraw->clrTextHighlight = GetSysColor(COLOR_HIGHLIGHTTEXT);
|
clrTextHighlight = GetSysColor(COLOR_HIGHLIGHTTEXT);
|
||||||
cdraw->clrHighlightHotTrack = GetSysColor(COLOR_HIGHLIGHTTEXT);
|
|
||||||
|
|
||||||
bgBrush = GetSysColorBrush(COLOR_MENU);
|
bgBrush = GetSysColorBrush(COLOR_MENU);
|
||||||
hotBrush = GetSysColorBrush(COLOR_MENUHILIGHT);
|
hotBrush = GetSysColorBrush(useFlatMenus ? COLOR_MENUHILIGHT : COLOR_HIGHLIGHT);
|
||||||
|
|
||||||
rc = cdraw->nmcd.rc;
|
rc = cdraw->nmcd.rc;
|
||||||
hdc = cdraw->nmcd.hdc;
|
hdc = cdraw->nmcd.hdc;
|
||||||
|
@ -750,9 +753,13 @@ HRESULT STDMETHODCALLTYPE CMenuBand::OnWinEvent(HWND hWnd, UINT uMsg, WPARAM wPa
|
||||||
case CDIS_HOT:
|
case CDIS_HOT:
|
||||||
case CDIS_FOCUS:
|
case CDIS_FOCUS:
|
||||||
FillRect(hdc, &rc, hotBrush);
|
FillRect(hdc, &rc, hotBrush);
|
||||||
|
SetTextColor(hdc, clrTextHighlight);
|
||||||
|
cdraw->clrText = clrTextHighlight;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
FillRect(hdc, &rc, bgBrush);
|
FillRect(hdc, &rc, bgBrush);
|
||||||
|
SetTextColor(hdc, clrText);
|
||||||
|
cdraw->clrText = clrText;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue