[Wine-patches] eterbug6882: user32: icon in popupmenu
roman
romand на office.etersoft.ru
Сб Мар 19 17:36:14 MSK 2011
eterbug6882: user32: icon in popupmenu
----------- следующая часть -----------
From cf699210dea52d4970c59de6521c8ab5d5102247 Mon Sep 17 00:00:00 2001
From: Roman Dadkov <cunning на etersoft.ru>
Date: Fri, 18 Mar 2011 21:20:56 +0300
Subject: [PATCH] eterbug6882: user32: icon in popupmenu
---
dlls/user32/menu.c | 17 ++++++++++++-----
1 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/dlls/user32/menu.c b/dlls/user32/menu.c
index e723983..0426224 100644
--- a/dlls/user32/menu.c
+++ b/dlls/user32/menu.c
@@ -1415,6 +1415,9 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc,
UINT arrow_bitmap_width = 0, arrow_bitmap_height = 0;
POPUPMENU *menu = MENU_GetMenu(hmenu);
RECT bmprc;
+ MENUITEM *item;
+ UINT u;
+ BOOL ItemShift = FALSE;
debug_print_menuitem("MENU_DrawMenuItem: ", lpitem, "");
if (!menu) {
@@ -1686,12 +1689,16 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc,
hfontOld = SelectObject( hdc, get_menu_font(TRUE) );
}
- if (menuBar) {
- if( lpitem->hbmpItem)
+ if (!menuBar) {
+ item = menu->items;
+ for (u = menu->nItems; u > 0; u--, item++)
+ if (item->hbmpItem) ItemShift = TRUE;
+ if (lpitem->hbmpItem)
rect.left += lpitem->bmpsize.cx;
- if( !(lpitem->hbmpItem == HBMMENU_CALLBACK))
- rect.left += menucharsize.cx;
- rect.right -= menucharsize.cx;
+ if (!(lpitem->hbmpItem == HBMMENU_CALLBACK))
+ if (ItemShift) rect.left += 4*menucharsize.cx;
+ else rect.left += menucharsize.cx;
+ rect.right -= menucharsize.cx;
}
for (i = 0; lpitem->text[i]; i++)
--
1.7.4.1
Подробная информация о списке рассылки Wine-patches