2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-10-15 14:26:04 +00:00

Add an option to use Qt scale engine (#158)

This commit is contained in:
ilya-fedin
2021-04-01 21:31:06 +00:00
committed by GitHub
parent 93c6a05f60
commit 2a92568954
11 changed files with 57 additions and 7 deletions

View File

@@ -200,7 +200,7 @@ void Sandbox::setupScreenScale() {
}
const auto ratio = devicePixelRatio();
if (ratio > 1.) {
if (ratio > 1. || cQtScale()) {
if (!Platform::IsMac() || (ratio != 2.)) {
LOG(("Found non-trivial Device Pixel Ratio: %1").arg(ratio));
LOG(("Environmental variables: QT_DEVICE_PIXEL_RATIO='%1'").arg(qEnvironmentVariable("QT_DEVICE_PIXEL_RATIO")));
@@ -209,7 +209,7 @@ void Sandbox::setupScreenScale() {
LOG(("Environmental variables: QT_SCREEN_SCALE_FACTORS='%1'").arg(qEnvironmentVariable("QT_SCREEN_SCALE_FACTORS")));
}
style::SetDevicePixelRatio(int(ratio));
if (Platform::IsMac() && ratio == 2.) {
if (Platform::IsMac() && ratio == 2. && !cQtScale()) {
cSetScreenScale(110); // 110% for Retina screens by default.
} else {
cSetScreenScale(style::kScaleDefault);