From 0aa27af8014f5344d604b3f4eaa5f0a2fb2b44e5 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 16 Oct 2018 13:19:24 +0200 Subject: Windows QPA: Add helper function to obtain DPI-dependent metrics on Windows 10 Use newly introduced SystemParametersInfoForDpi() API with some convenience overloads. Task-number: QTBUG-4362 Change-Id: I4c41c700007bf7cc4fd5868356e3145c136704c0 Reviewed-by: Oliver Wolff --- src/plugins/platforms/windows/qwindowstheme.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/plugins/platforms/windows/qwindowstheme.cpp') diff --git a/src/plugins/platforms/windows/qwindowstheme.cpp b/src/plugins/platforms/windows/qwindowstheme.cpp index d01a7b0a8a..4b70e915a8 100644 --- a/src/plugins/platforms/windows/qwindowstheme.cpp +++ b/src/plugins/platforms/windows/qwindowstheme.cpp @@ -507,9 +507,7 @@ void QWindowsTheme::refreshFonts() if (!QGuiApplication::desktopSettingsAware()) return; NONCLIENTMETRICS ncm; - ncm.cbSize = FIELD_OFFSET(NONCLIENTMETRICS, lfMessageFont) + sizeof(LOGFONT); - SystemParametersInfo(SPI_GETNONCLIENTMETRICS, ncm.cbSize , &ncm, 0); - + QWindowsContext::nonClientMetrics(&ncm); const QFont menuFont = QWindowsFontDatabase::LOGFONT_to_QFont(ncm.lfMenuFont); const QFont messageBoxFont = QWindowsFontDatabase::LOGFONT_to_QFont(ncm.lfMessageFont); const QFont statusFont = QWindowsFontDatabase::LOGFONT_to_QFont(ncm.lfStatusFont); -- cgit v1.2.3