Fix For Menu Bar (resend)

William Poetra Yoga H williampoetra at yahoo.com
Tue Nov 9 09:38:02 CST 2004


This fixes the size of the menu bar and its menu items (affects two files).

William



		
__________________________________ 
Do you Yahoo!? 
Check out the new Yahoo! Front Page. 
www.yahoo.com 
 
-------------- next part --------------
Index: dlls/user/menu.c
===================================================================
RCS file: /home/wine/wine/dlls/user/menu.c,v
retrieving revision 1.8
diff -u -r1.8 menu.c
--- dlls/user/menu.c	8 Nov 2004 22:12:42 -0000	1.8
+++ dlls/user/menu.c	9 Nov 2004 14:26:09 -0000
@@ -1043,7 +1043,7 @@
           lprect->left, lprect->top, lprect->right, lprect->bottom);
     lppop->Width  = lprect->right - lprect->left;
     lppop->Height = 0;
-    maxY = lprect->top+1;
+    maxY = lprect->top;
     start = 0;
     helpPos = -1;
     while (start < lppop->nItems)
@@ -1077,7 +1077,7 @@
 	while (start < i) lppop->items[start++].rect.bottom = maxY;
     }
 
-    lprect->bottom = maxY;
+    lprect->bottom = maxY + 1;
     lppop->Height = lprect->bottom - lprect->top;
 
     /* Flush right all items between the MF_RIGHTJUSTIFY and */
@@ -1431,7 +1431,7 @@
     lppop = MENU_GetMenu( hMenu );
     if (lppop == NULL || lprect == NULL)
     {
-        return GetSystemMetrics(SM_CYMENU);
+        return GetSystemMetrics(SM_CYMENU) + 1;
     }
 
     if (suppress_draw)
@@ -1441,8 +1441,6 @@
 	if (lppop->Height == 0)
 		MENU_MenuBarCalcSize(hDC, lprect, lppop, hwnd);
 
-	lprect->bottom = lprect->top + lppop->Height;
-
         if (hfontOld) SelectObject( hDC, hfontOld);
 	return lppop->Height;
     }
@@ -3765,7 +3763,7 @@
     lppop = MENU_GetMenu( hMenu );
     if (lppop == NULL || lprect == NULL)
     {
-        retvalue = GetSystemMetrics(SM_CYMENU);
+        retvalue = GetSystemMetrics(SM_CYMENU) + 1;
         goto END;
     }
 
@@ -3776,17 +3774,17 @@
     if (lppop->Height == 0)
         MENU_MenuBarCalcSize(hDC, lprect, lppop, hwnd);
 
-    lprect->bottom = lprect->top + lppop->Height;
-
     FillRect(hDC, lprect, GetSysColorBrush(COLOR_MENU) );
 
+#if 0
     SelectObject( hDC, SYSCOLOR_GetPen(COLOR_3DFACE));
     MoveToEx( hDC, lprect->left, lprect->bottom, NULL );
     LineTo( hDC, lprect->right, lprect->bottom );
+#endif
 
     if (lppop->nItems == 0)
     {
-        retvalue = GetSystemMetrics(SM_CYMENU);
+        retvalue = GetSystemMetrics(SM_CYMENU) + 1;
         goto END;
     }
 
Index: windows/nonclient.c
===================================================================
RCS file: /home/wine/wine/windows/nonclient.c,v
retrieving revision 1.127
diff -u -r1.127 nonclient.c
--- windows/nonclient.c	8 Nov 2004 22:11:48 -0000	1.127
+++ windows/nonclient.c	9 Nov 2004 14:26:20 -0000
@@ -400,7 +400,7 @@
 	    winRect->top +=
 		MENU_GetMenuBarHeight( hwnd,
 				       winRect->right - winRect->left,
-				       -tmpRect.left, -tmpRect.top ) + 1;
+				       -tmpRect.left, -tmpRect.top );
 	}
 
 	SetRect(&tmpRect, 0, 0, 0, 0);
@@ -1029,7 +1034,7 @@
 	TRACE("Calling DrawMenuBar with rect (%ld, %ld)-(%ld, %ld)\n",
               r.left, r.top, r.right, r.bottom);
 
-	rect.top += MENU_DrawMenuBar( hdc, &r, hwnd, suppress_menupaint ) + 1;
+	rect.top += MENU_DrawMenuBar( hdc, &r, hwnd, suppress_menupaint );
     }
 
     TRACE("After MenuBar, rect is (%ld, %ld)-(%ld, %ld).\n",


More information about the wine-patches mailing list