mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Use QPlatformScreen::logicalDpi instead of QScreen::logicalDotsPerInch
QScreen::logicalDotsPerInch can be overriden by QT_FONT_DPI what is not good
This commit is contained in:
parent
f882a0f407
commit
9a4b8cdd82
1 changed files with 6 additions and 1 deletions
|
@ -31,6 +31,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
|
||||
#include <QtGui/QSessionManager>
|
||||
#include <QtGui/QScreen>
|
||||
#include <qpa/qplatformscreen.h>
|
||||
|
||||
namespace Core {
|
||||
namespace {
|
||||
|
@ -183,7 +184,11 @@ void Sandbox::launchApplication() {
|
|||
}
|
||||
|
||||
void Sandbox::setupScreenScale() {
|
||||
const auto dpi = Sandbox::primaryScreen()->logicalDotsPerInch();
|
||||
const auto processDpi = [](const QDpi &dpi) {
|
||||
return (dpi.first + dpi.second) * qreal(0.5);
|
||||
};
|
||||
const auto dpi = processDpi(
|
||||
Sandbox::primaryScreen()->handle()->logicalDpi());
|
||||
LOG(("Primary screen DPI: %1").arg(dpi));
|
||||
if (dpi <= 108) {
|
||||
cSetScreenScale(100); // 100%: 96 DPI (0-108)
|
||||
|
|
Loading…
Add table
Reference in a new issue