Huw Davies : user32: Disable scrolling for multi-column menus.
Alexandre Julliard
julliard at winehq.org
Thu Mar 30 15:18:03 CDT 2017
Module: wine
Branch: master
Commit: 1d4992282d8e36cf4c4836045d042c983a3d6f0c
URL: http://source.winehq.org/git/wine.git/?a=commit;h=1d4992282d8e36cf4c4836045d042c983a3d6f0c
Author: Huw Davies <huw at codeweavers.com>
Date: Thu Mar 30 10:58:32 2017 +0100
user32: Disable scrolling for multi-column menus.
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/user32/menu.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/dlls/user32/menu.c b/dlls/user32/menu.c
index dd62063..543e0c1 100644
--- a/dlls/user32/menu.c
+++ b/dlls/user32/menu.c
@@ -1159,7 +1159,7 @@ static void MENU_PopupMenuCalcSize( LPPOPUPMENU lppop )
MENUITEM *lpitem;
HDC hdc;
UINT start, i;
- BOOL textandbmp = FALSE;
+ BOOL textandbmp = FALSE, multi_col = FALSE;
int orgX, orgY, maxTab, maxTabWidth, maxHeight;
lppop->Width = lppop->Height = 0;
@@ -1186,8 +1186,11 @@ static void MENU_PopupMenuCalcSize( LPPOPUPMENU lppop )
/* Parse items until column break or end of menu */
for (i = start; i < lppop->nItems; i++, lpitem++)
{
- if ((i != start) &&
- (lpitem->fType & (MF_MENUBREAK | MF_MENUBARBREAK))) break;
+ if (lpitem->fType & (MF_MENUBREAK | MF_MENUBARBREAK))
+ {
+ multi_col = TRUE;
+ if (i != start) break;
+ }
MENU_CalcItemSize( hdc, lpitem, lppop->hwndOwner, orgX, orgY, FALSE, lppop );
lppop->items_rect.right = max( lppop->items_rect.right, lpitem->rect.right );
@@ -1231,10 +1234,13 @@ static void MENU_PopupMenuCalcSize( LPPOPUPMENU lppop )
if (lppop->Height >= maxHeight)
{
lppop->Height = maxHeight;
+ lppop->bScrolling = !multi_col;
/* When the scroll arrows are present, don't add the top/bottom margin as well */
- lppop->items_rect.top += get_scroll_arrow_height(lppop) - MENU_MARGIN;
- lppop->items_rect.bottom = lppop->Height - get_scroll_arrow_height(lppop);
- lppop->bScrolling = TRUE;
+ if (lppop->bScrolling)
+ {
+ lppop->items_rect.top = get_scroll_arrow_height(lppop);
+ lppop->items_rect.bottom = lppop->Height - get_scroll_arrow_height(lppop);
+ }
}
else
{
More information about the wine-cvs
mailing list