Commit 7214fdfc authored by Ge van Geldorp's avatar Ge van Geldorp Committed by Alexandre Julliard

Setup menu drawing colors before calling owner draw routine.

parent 9de14a1c
...@@ -1116,6 +1116,30 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc, ...@@ -1116,6 +1116,30 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc,
return; return;
} }
/* Setup colors */
if (lpitem->fState & MF_HILITE)
{
if(menuBar) {
SetTextColor(hdc, GetSysColor(COLOR_MENUTEXT));
SetBkColor(hdc, GetSysColor(COLOR_MENU));
} else {
if(lpitem->fState & MF_GRAYED)
SetTextColor(hdc, GetSysColor(COLOR_GRAYTEXT));
else
SetTextColor(hdc, GetSysColor(COLOR_HIGHLIGHTTEXT));
SetBkColor(hdc, GetSysColor(COLOR_HIGHLIGHT));
}
}
else
{
if (lpitem->fState & MF_GRAYED)
SetTextColor( hdc, GetSysColor( COLOR_GRAYTEXT ) );
else
SetTextColor( hdc, GetSysColor( COLOR_MENUTEXT ) );
SetBkColor( hdc, GetSysColor( COLOR_MENU ) );
}
if (lpitem->fType & MF_OWNERDRAW) if (lpitem->fType & MF_OWNERDRAW)
{ {
/* /*
...@@ -1195,30 +1219,6 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc, ...@@ -1195,30 +1219,6 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc,
} }
} }
/* Setup colors */
if (lpitem->fState & MF_HILITE)
{
if(menuBar) {
SetTextColor(hdc, GetSysColor(COLOR_MENUTEXT));
SetBkColor(hdc, GetSysColor(COLOR_MENU));
} else {
if(lpitem->fState & MF_GRAYED)
SetTextColor(hdc, GetSysColor(COLOR_GRAYTEXT));
else
SetTextColor(hdc, GetSysColor(COLOR_HIGHLIGHTTEXT));
SetBkColor(hdc, GetSysColor(COLOR_HIGHLIGHT));
}
}
else
{
if (lpitem->fState & MF_GRAYED)
SetTextColor( hdc, GetSysColor( COLOR_GRAYTEXT ) );
else
SetTextColor( hdc, GetSysColor( COLOR_MENUTEXT ) );
SetBkColor( hdc, GetSysColor( COLOR_MENU ) );
}
/* helper lines for debugging */ /* helper lines for debugging */
/* FrameRect(hdc, &rect, GetStockObject(BLACK_BRUSH)); /* FrameRect(hdc, &rect, GetStockObject(BLACK_BRUSH));
SelectObject( hdc, SYSCOLOR_GetPen(COLOR_WINDOWFRAME) ); SelectObject( hdc, SYSCOLOR_GetPen(COLOR_WINDOWFRAME) );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment