win32u: Support HiDPI for the non-client close button in WS_EX_TOOLWINDOW windows.

This commit is contained in:
Zhiyi Zhang 2024-03-14 12:27:02 +08:00 committed by Alexandre Julliard
parent a5a0bc10f9
commit 2f094cbfe6

View file

@ -1462,8 +1462,8 @@ static void draw_close_button( HWND hwnd, HDC hdc, BOOL down, BOOL grayed )
{
/* Windows does not use SM_CXSMSIZE and SM_CYSMSIZE
* it uses 11x11 for the close button in tool window */
const int bmp_height = 11;
const int bmp_width = 11;
int bmp_height = muldiv( 11, get_dpi_for_window( hwnd ), 96 );
int bmp_width = bmp_height;
int caption_height = get_system_metrics( SM_CYSMCAPTION );
rect.top = rect.top + (caption_height - 1 - bmp_height) / 2;