mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-11 07:18:08 +00:00
Use screen real physical DPI on Windows
Previously was using a hardcoded value which might lead to issues like #11234.
This commit is contained in:
parent
339e195043
commit
0760398e99
@ -66,8 +66,9 @@ qreal Utils::Gui::screenScalingFactor(const QWidget *widget)
|
|||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
const int screen = qApp->desktop()->screenNumber(widget);
|
const int screenNumber = qApp->desktop()->screenNumber(widget);
|
||||||
return (QApplication::screens()[screen]->logicalDotsPerInch() / 96);
|
const QScreen *screen = QApplication::screens()[screenNumber];
|
||||||
|
return (screen->logicalDotsPerInch() / screen->physicalDotsPerInch());
|
||||||
#elif defined(Q_OS_MACOS)
|
#elif defined(Q_OS_MACOS)
|
||||||
return 1;
|
return 1;
|
||||||
#else
|
#else
|
||||||
|
Loading…
Reference in New Issue
Block a user