mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-01 16:53:37 +00:00
comctl32: 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:
parent
615a90e219
commit
7be103bba9
|
@ -1317,7 +1317,7 @@ static LRESULT DATETIME_NCPaint (HWND hwnd, HRGN region)
|
|||
RECT r;
|
||||
HDC dc;
|
||||
|
||||
theme = OpenThemeData(NULL, WC_EDITW);
|
||||
theme = OpenThemeDataForDpi(NULL, WC_EDITW, GetDpiForWindow(hwnd));
|
||||
if (!theme)
|
||||
return DefWindowProcW(hwnd, WM_NCPAINT, (WPARAM)region, 0);
|
||||
|
||||
|
|
|
@ -434,7 +434,7 @@ HOTKEY_NCPaint (HWND hwnd, HRGN region)
|
|||
RECT r;
|
||||
HDC dc;
|
||||
|
||||
theme = OpenThemeData(NULL, WC_EDITW);
|
||||
theme = OpenThemeDataForDpi(NULL, WC_EDITW, GetDpiForWindow(hwnd));
|
||||
if (!theme)
|
||||
return DefWindowProcW(hwnd, WM_NCPAINT, (WPARAM)region, 0);
|
||||
|
||||
|
|
|
@ -5313,7 +5313,7 @@ TOOLBAR_Create (HWND hwnd, const CREATESTRUCTW *lpcs)
|
|||
|
||||
SystemParametersInfoW (SPI_GETICONTITLELOGFONT, 0, &logFont, 0);
|
||||
infoPtr->hFont = infoPtr->hDefaultFont = CreateFontIndirectW (&logFont);
|
||||
infoPtr->hTheme = OpenThemeData (NULL, themeClass);
|
||||
infoPtr->hTheme = OpenThemeDataForDpi (NULL, themeClass, GetDpiForWindow (hwnd));
|
||||
|
||||
TOOLBAR_CheckStyle (infoPtr);
|
||||
|
||||
|
@ -6550,7 +6550,7 @@ TOOLBAR_SysColorChange (void)
|
|||
static LRESULT theme_changed (TOOLBAR_INFO *infoPtr)
|
||||
{
|
||||
CloseThemeData (infoPtr->hTheme);
|
||||
infoPtr->hTheme = OpenThemeData (NULL, themeClass);
|
||||
infoPtr->hTheme = OpenThemeDataForDpi (NULL, themeClass, GetDpiForWindow (infoPtr->hwndSelf));
|
||||
InvalidateRect (infoPtr->hwndSelf, NULL, TRUE);
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue