Commit c72a7219 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

user32: Add a helper to retrieve the height of the scroll arrows.

parent a8344b96
...@@ -404,6 +404,14 @@ static HBITMAP get_up_arrow_inactive_bitmap(void) ...@@ -404,6 +404,14 @@ static HBITMAP get_up_arrow_inactive_bitmap(void)
return arrow_bitmap; return arrow_bitmap;
} }
static inline UINT get_scroll_arrow_height(const POPUPMENU *menu)
{
BITMAP bmp;
GetObjectW(get_up_arrow_bitmap(), sizeof(bmp), &bmp);
return bmp.bmHeight;
}
/*********************************************************************** /***********************************************************************
* MENU_CopySysPopup * MENU_CopySysPopup
* *
...@@ -699,13 +707,10 @@ MENU_AdjustMenuItemRect(const POPUPMENU *menu, LPRECT rect) ...@@ -699,13 +707,10 @@ MENU_AdjustMenuItemRect(const POPUPMENU *menu, LPRECT rect)
{ {
if (menu->bScrolling) if (menu->bScrolling)
{ {
UINT arrow_bitmap_height; UINT arrow_height;
BITMAP bmp;
GetObjectW(get_up_arrow_bitmap(), sizeof(bmp), &bmp); arrow_height = get_scroll_arrow_height( menu );
arrow_bitmap_height = bmp.bmHeight; OffsetRect( rect, 0, arrow_height - menu->nScrollPos );
rect->top += arrow_bitmap_height - menu->nScrollPos;
rect->bottom += arrow_bitmap_height - menu->nScrollPos;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment