user32: Popup menu position fixes.
- Open large popup menus on the other side only if there's enough space - Open popup menus such that the y position of the first item in the popup menu is the same as the y position of the focused menu item.
This commit is contained in:
parent
81b5450cff
commit
6a74137d70
|
@ -1796,8 +1796,9 @@ static BOOL MENU_ShowPopup( HWND hwndOwner, HMENU hmenu, UINT id,
|
||||||
|
|
||||||
if( x + width > GetSystemMetrics(SM_CXSCREEN ))
|
if( x + width > GetSystemMetrics(SM_CXSCREEN ))
|
||||||
{
|
{
|
||||||
if( xanchor )
|
if( xanchor && x >= width - xanchor )
|
||||||
x -= width - xanchor;
|
x -= width - xanchor;
|
||||||
|
|
||||||
if( x + width > GetSystemMetrics(SM_CXSCREEN))
|
if( x + width > GetSystemMetrics(SM_CXSCREEN))
|
||||||
x = GetSystemMetrics(SM_CXSCREEN) - width;
|
x = GetSystemMetrics(SM_CXSCREEN) - width;
|
||||||
}
|
}
|
||||||
|
@ -1805,8 +1806,9 @@ static BOOL MENU_ShowPopup( HWND hwndOwner, HMENU hmenu, UINT id,
|
||||||
|
|
||||||
if( y + height > GetSystemMetrics(SM_CYSCREEN ))
|
if( y + height > GetSystemMetrics(SM_CYSCREEN ))
|
||||||
{
|
{
|
||||||
if( yanchor )
|
if( yanchor && y >= height + yanchor )
|
||||||
y -= height + yanchor;
|
y -= height + yanchor;
|
||||||
|
|
||||||
if( y + height > GetSystemMetrics(SM_CYSCREEN ))
|
if( y + height > GetSystemMetrics(SM_CYSCREEN ))
|
||||||
y = GetSystemMetrics(SM_CYSCREEN) - height;
|
y = GetSystemMetrics(SM_CYSCREEN) - height;
|
||||||
}
|
}
|
||||||
|
@ -2339,10 +2341,14 @@ static HMENU MENU_ShowSubPopup( HWND hwndOwner, HMENU hmenu,
|
||||||
RECT rc = item->rect;
|
RECT rc = item->rect;
|
||||||
|
|
||||||
MENU_AdjustMenuItemRect(menu, &rc);
|
MENU_AdjustMenuItemRect(menu, &rc);
|
||||||
|
|
||||||
|
/* The first item in the popup menu has to be at the
|
||||||
|
same y position as the focused menu item */
|
||||||
rect.left += rc.right - GetSystemMetrics(SM_CXBORDER);
|
rect.left += rc.right - GetSystemMetrics(SM_CXBORDER);
|
||||||
rect.top += rc.top;
|
rect.top += rc.top - MENU_TOP_MARGIN;
|
||||||
rect.right = rc.left - rc.right + GetSystemMetrics(SM_CXBORDER);
|
rect.right = rc.left - rc.right + GetSystemMetrics(SM_CXBORDER);
|
||||||
rect.bottom = rc.top - rc.bottom;
|
rect.bottom = rc.top - rc.bottom - MENU_TOP_MARGIN
|
||||||
|
- MENU_BOTTOM_MARGIN - GetSystemMetrics(SM_CYBORDER);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue