https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ed41bd71dd13ad68af40a…
commit ed41bd71dd13ad68af40a55b4b36549a834e7eaf
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Sat Oct 27 04:20:09 2018 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Sat Oct 27 04:20:09 2018 +0900
[WIN32SS][NTUSER] Sunken menu item (#981)
CORE-15226
---
win32ss/user/ntuser/menu.c | 28 +++++++++++++++++++++++++++-
1 file changed, 27 insertions(+), 1 deletion(-)
diff --git a/win32ss/user/ntuser/menu.c b/win32ss/user/ntuser/menu.c
index f4159030cc..dfab116bbc 100644
--- a/win32ss/user/ntuser/menu.c
+++ b/win32ss/user/ntuser/menu.c
@@ -1657,9 +1657,12 @@ static void FASTCALL MENU_DrawBitmapItem(HDC hdc, PITEM lpitem,
const RECT *rect
int h = rect->bottom - rect->top;
int bmp_xoffset = 0;
int left, top;
+ BOOL flat_menu;
HBITMAP hbmToDraw = lpitem->hbmp;
bmp = hbmToDraw;
+ UserSystemParametersInfo(SPI_GETFLATMENU, 0, &flat_menu, 0);
+
/* Check if there is a magic menu item associated with this item */
if (IS_MAGIC_BITMAP(hbmToDraw))
{
@@ -1778,6 +1781,12 @@ static void FASTCALL MENU_DrawBitmapItem(HDC hdc, PITEM lpitem,
const RECT *rect
rop=((lpitem->fState & MF_HILITE) && !IS_MAGIC_BITMAP(hbmToDraw)) ?
NOTSRCCOPY : SRCCOPY;
if ((lpitem->fState & MF_HILITE) && lpitem->hbmp)
IntGdiSetBkColor(hdc, IntGetSysColor(COLOR_HIGHLIGHT));
+ if (!flat_menu &&
+ (lpitem->fState & (MF_HILITE | MF_GRAYED)) == MF_HILITE)
+ {
+ ++left;
+ ++top;
+ }
NtGdiBitBlt( hdc, left, top, w, h, hdcMem, bmp_xoffset, 0, rop , 0, 0);
IntGdiDeleteDC( hdcMem, FALSE );
}
@@ -2325,10 +2334,15 @@ static void FASTCALL MENU_DrawMenuItem(PWND Wnd, PMENU Menu, PWND
WndOwner, HDC
}
else
{
- if(menuBar)
+ if (menuBar)
+ {
+ FillRect(hdc, &rect, IntGetSysColorBrush(COLOR_MENU));
DrawEdge(hdc, &rect, BDR_SUNKENOUTER, BF_RECT);
+ }
else
+ {
FillRect(hdc, &rect, IntGetSysColorBrush(COLOR_HIGHLIGHT));
+ }
}
}
else
@@ -2517,6 +2531,12 @@ static void FASTCALL MENU_DrawMenuItem(PWND Wnd, PMENU Menu, PWND
WndOwner, HDC
break;
}
+ if (!flat_menu &&
+ (lpitem->fState & (MF_HILITE | MF_GRAYED)) == MF_HILITE)
+ {
+ RECTL_vOffsetRect(&rect, +1, +1);
+ }
+
if(lpitem->fState & MF_GRAYED)
{
if (!(lpitem->fState & MF_HILITE) )
@@ -2558,6 +2578,12 @@ static void FASTCALL MENU_DrawMenuItem(PWND Wnd, PMENU Menu, PWND
WndOwner, HDC
DrawTextW( hdc, Text + i + 1, -1, &rect, uFormat );
}
+ if (!flat_menu &&
+ (lpitem->fState & (MF_HILITE | MF_GRAYED)) == MF_HILITE)
+ {
+ RECTL_vOffsetRect(&rect, -1, -1);
+ }
+
if (hfontOld)
{
NtGdiSelectFont (hdc, hfontOld);