user32: Disable scrolling for multi-column menus.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Huw Davies 2017-03-30 10:58:32 +01:00 committed by Alexandre Julliard
parent d4544f7fed
commit 1d4992282d
1 changed files with 12 additions and 6 deletions

View File

@ -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;
if (lppop->bScrolling)
{
lppop->items_rect.top = get_scroll_arrow_height(lppop);
lppop->items_rect.bottom = lppop->Height - get_scroll_arrow_height(lppop);
lppop->bScrolling = TRUE;
}
}
else
{