diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-10-16 13:19:24 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-10-17 19:11:10 +0000 |
commit | 0aa27af8014f5344d604b3f4eaa5f0a2fb2b44e5 (patch) | |
tree | 3052b7062563660e4ece44be9a2ee609333a7f70 /src/plugins/platforms/windows/qwindowstheme.cpp | |
parent | 17fc079acd9cad3985a1f9cafaeaea6eec1a734f (diff) |
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 <oliver.wolff@qt.io>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowstheme.cpp')
-rw-r--r-- | src/plugins/platforms/windows/qwindowstheme.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
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); |