From 60f5e7c0eb82abd86e7eef732b3bcf41745dc331 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Tue, 16 Jun 2015 13:21:58 +0200 Subject: Scale logicalDpi when turning on screen scaling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Assume that the logical DPI for the primary screen is sane, and keep font sizes constant as screens are scaled. The global scale factor will act as a zoom level, and will cause all fonts to be bigger. Note that since we do not change logicalDpi after application startup, the manual test sliders will not match what happens with auto scaling. We may want to fix that... Change-Id: I5a3daa57c2dacf0158836492d31573723e49399a Reviewed-by: Morten Johan Sørvig --- src/plugins/platforms/windows/qwindowsscreen.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/windows/qwindowsscreen.cpp b/src/plugins/platforms/windows/qwindowsscreen.cpp index 7f3bb96503..391735a035 100644 --- a/src/plugins/platforms/windows/qwindowsscreen.cpp +++ b/src/plugins/platforms/windows/qwindowsscreen.cpp @@ -117,14 +117,12 @@ static bool monitorData(HMONITOR hMonitor, QWindowsScreenData *data) HDC hdc = CreateDC(info.szDevice, NULL, NULL, NULL); #endif if (hdc) { - if (!QHighDpiScaling::isActive()) { // Assume 96 DPI to get fonts right when scaling. #ifndef Q_OS_WINCE - const QDpi dpi = monitorDPI(hMonitor); - data->dpi = dpi.first ? dpi : deviceDPI(hdc); + const QDpi dpi = monitorDPI(hMonitor); + data->dpi = dpi.first ? dpi : deviceDPI(hdc); #else - data->dpi = deviceDPI(hdc); + data->dpi = deviceDPI(hdc); #endif - } data->depth = GetDeviceCaps(hdc, BITSPIXEL); data->format = data->depth == 16 ? QImage::Format_RGB16 : QImage::Format_RGB32; data->physicalSizeMM = QSizeF(GetDeviceCaps(hdc, HORZSIZE), GetDeviceCaps(hdc, VERTSIZE)); -- cgit v1.2.3