Browse Source

Use screen real physical DPI on Windows

Previously was using a hardcoded value which might lead to issues like #11234.
adaptive-webui-19844
Chocobo1 5 years ago
parent
commit
0760398e99
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
  1. 5
      src/gui/utils.cpp

5
src/gui/utils.cpp

@ -66,8 +66,9 @@ qreal Utils::Gui::screenScalingFactor(const QWidget *widget) @@ -66,8 +66,9 @@ qreal Utils::Gui::screenScalingFactor(const QWidget *widget)
return 1;
#ifdef Q_OS_WIN
const int screen = qApp->desktop()->screenNumber(widget);
return (QApplication::screens()[screen]->logicalDotsPerInch() / 96);
const int screenNumber = qApp->desktop()->screenNumber(widget);
const QScreen *screen = QApplication::screens()[screenNumber];
return (screen->logicalDotsPerInch() / screen->physicalDotsPerInch());
#elif defined(Q_OS_MACOS)
return 1;
#else

Loading…
Cancel
Save