diff options
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/windows/qwindowstheme.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/plugins/platforms/windows/qwindowstheme.cpp b/src/plugins/platforms/windows/qwindowstheme.cpp index 7f47cd712f..25e083fd5c 100644 --- a/src/plugins/platforms/windows/qwindowstheme.cpp +++ b/src/plugins/platforms/windows/qwindowstheme.cpp @@ -51,6 +51,7 @@ #if QT_CONFIG(systemtrayicon) # include "qwindowssystemtrayicon.h" #endif +#include "qwindowsscreen.h" #include "qt_windows.h" #include <commctrl.h> #include <objbase.h> @@ -564,13 +565,32 @@ void QWindowsTheme::refresh() refreshFonts(); } +#ifndef QT_NO_DEBUG_STREAM +QDebug operator<<(QDebug d, const LOGFONT &lf); // in platformsupport + +QDebug operator<<(QDebug d, const NONCLIENTMETRICS &m) +{ + QDebugStateSaver saver(d); + d.nospace(); + d.noquote(); + d << "NONCLIENTMETRICS(iMenu=" << m.iMenuWidth << 'x' << m.iMenuHeight + << ", lfCaptionFont=" << m.lfCaptionFont << ", lfSmCaptionFont=" + << m.lfSmCaptionFont << ", lfMenuFont=" << m.lfMenuFont + << ", lfMessageFont=" << m.lfMessageFont << ", lfStatusFont=" + << m.lfStatusFont << ')'; + return d; +} +#endif // QT_NO_DEBUG_STREAM + void QWindowsTheme::refreshFonts() { clearFonts(); if (!QGuiApplication::desktopSettingsAware()) return; NONCLIENTMETRICS ncm; - QWindowsContext::nonClientMetrics(&ncm); + auto screenManager = QWindowsContext::instance()->screenManager(); + QWindowsContext::nonClientMetricsForScreen(&ncm, screenManager.screens().value(0)); + qCDebug(lcQpaWindows) << __FUNCTION__ << 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); |