From 3a0b40fffb2894be48bfa36f72afe0b4821b074b Mon Sep 17 00:00:00 2001 From: Rein Klazes Date: Mon, 20 Feb 2006 19:19:36 +0100 Subject: [PATCH] menu: Take the MF_DEFAULT flag in to account in MENU_CalcItemSize. --- dlls/user/menu.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/user/menu.c b/dlls/user/menu.c index 2f58cb09ead..a72e9222a32 100644 --- a/dlls/user/menu.c +++ b/dlls/user/menu.c @@ -1026,10 +1026,14 @@ static void MENU_CalcItemSize( HDC hdc, MENUITEM *lpitem, HWND hwndOwner, /* it must be a text item - unless it's the system menu */ if (!(lpitem->fType & MF_SYSMENU) && lpitem->text) { + HFONT hfontOld = NULL; RECT rc = lpitem->rect; LONG txtheight, txtwidth; lpitem->xTab = 0; + if ( lpitem->fState & MFS_DEFAULT ) { + hfontOld = SelectObject( hdc, get_menu_font(TRUE) ); + } if (menuBar) { txtheight = DrawTextW( hdc, lpitem->text, -1, &rc, DT_SINGLELINE|DT_CALCRECT); @@ -1071,6 +1075,7 @@ static void MENU_CalcItemSize( HDC hdc, MENUITEM *lpitem, HWND hwndOwner, itemheight = max( itemheight, max( txtheight + 2, menucharsize.cy + 4)); } + if (hfontOld) SelectObject (hdc, hfontOld); } else if( menuBar) { itemheight = max( itemheight, GetSystemMetrics(SM_CYMENU)-1); } -- 2.11.4.GIT