winecfg: Use OpenThemeDataForDpi() to create a theme handle not associated to a window.

If a window is not passed to OpenThemeData(), OpenThemeData() assumes the DPI is 96 according to
tests. And GetThemePartSize() should select theme parts according to the DPI stored in theme
handles rather than using GDI device contexts. Thus, OpenThemeDataForDpi() should be used in place
of OpenThemeData() when DPI is not 96 and theme handles shouldn't be associated with a window.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zhiyi Zhang 2021-09-01 14:38:03 +08:00 committed by Alexandre Julliard
parent 8aed2ec3b9
commit 53a0d57aff
1 changed files with 1 additions and 1 deletions

View File

@ -1090,7 +1090,7 @@ static void on_draw_item(HWND hDlg, WPARAM wParam, LPARAM lParam)
HTHEME theme; HTHEME theme;
RECT buttonrect; RECT buttonrect;
theme = OpenThemeData(NULL, WC_BUTTONW); theme = OpenThemeDataForDpi(NULL, WC_BUTTONW, GetDpiForWindow(hDlg));
if (theme) { if (theme) {
MARGINS margins; MARGINS margins;