[MENU][WIN32SS] Fix non-menubar menu text Y position (#1199)

CORE-15226
This commit is contained in:
Katayama Hirofumi MZ 2018-12-28 12:12:42 +09:00 committed by GitHub
parent ec5c0c926b
commit 65f0926086
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -71,7 +71,7 @@ BOOL fInEndMenu = FALSE;
#define MENU_COL_SPACE 4 #define MENU_COL_SPACE 4
/* top and bottom margins for popup menus */ /* top and bottom margins for popup menus */
#define MENU_TOP_MARGIN 2 //3 #define MENU_TOP_MARGIN 3
#define MENU_BOTTOM_MARGIN 2 #define MENU_BOTTOM_MARGIN 2
#define MENU_ITEM_HBMP_SPACE (5) #define MENU_ITEM_HBMP_SPACE (5)
@ -2380,7 +2380,7 @@ static void FASTCALL MENU_DrawMenuItem(PWND Wnd, PMENU Menu, PWND WndOwner, HDC
rc.left++; rc.left++;
rc.right--; rc.right--;
rc.top = ( rc.top + rc.bottom) / 2; rc.top = (rc.top + rc.bottom) / 2 - 1;
if (flat_menu) if (flat_menu)
{ {
oldPen = NtGdiSelectPen( hdc, NtGdiGetStockObject(DC_PEN) ); oldPen = NtGdiSelectPen( hdc, NtGdiGetStockObject(DC_PEN) );
@ -2539,6 +2539,9 @@ static void FASTCALL MENU_DrawMenuItem(PWND Wnd, PMENU Menu, PWND WndOwner, HDC
RECTL_vOffsetRect(&rect, +1, +1); RECTL_vOffsetRect(&rect, +1, +1);
} }
if (!menuBar)
--rect.bottom;
if(lpitem->fState & MF_GRAYED) if(lpitem->fState & MF_GRAYED)
{ {
if (!(lpitem->fState & MF_HILITE) ) if (!(lpitem->fState & MF_HILITE) )
@ -2580,6 +2583,9 @@ static void FASTCALL MENU_DrawMenuItem(PWND Wnd, PMENU Menu, PWND WndOwner, HDC
DrawTextW( hdc, Text + i + 1, -1, &rect, uFormat ); DrawTextW( hdc, Text + i + 1, -1, &rect, uFormat );
} }
if (!menuBar)
++rect.bottom;
if (menuBar && if (menuBar &&
!flat_menu && !flat_menu &&
(lpitem->fState & (MF_HILITE | MF_GRAYED)) == MF_HILITE) (lpitem->fState & (MF_HILITE | MF_GRAYED)) == MF_HILITE)