summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/android
diff options
context:
space:
mode:
authorSamuel Mira <samuel.mira@qt.io>2022-12-21 15:39:44 +0200
committerSamuel Mira <samuel.mira@qt.io>2023-01-02 18:09:02 +0200
commit470587e7ca9a0c7886c820e2bf20fbded976b16f (patch)
tree8c0ad9f8b327f8eea7ae5efcc1505d05d386c3f9 /src/plugins/platforms/android
parentaa7b2436b5a357ea7d76eebaecab0c05719b5c91 (diff)
Android: Fix UI is scaled smaller than before
The 413593183bbb1137fdc784d98c171d67a167bb32 patch changed the way how the display metrics are retrieved. By doing so, it was found that the previous way retrieved the scaledDensity always equal to density. It is intentional for scaledDensity to be dependent on the font scale chosen by the user. However, this change altered not only the font scale but also the layout. This patch will make the layout dependent on the density instead of the scaledDensity and normalize the way the display metrics are retrieved among Android versions. Currently, the fontScale is ignored, QTBUG-109566 will track future developments. Fixes: QTBUG-109026 Change-Id: I6adacd17583cbe9bee368af35c50b780872ab222 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> (cherry picked from commit 99893a914a821567e10935ffb8be24df7147ccd9) Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/plugins/platforms/android')
-rw-r--r--src/plugins/platforms/android/qandroidplatformscreen.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/platforms/android/qandroidplatformscreen.cpp b/src/plugins/platforms/android/qandroidplatformscreen.cpp
index fd184e6757..410f95ac58 100644
--- a/src/plugins/platforms/android/qandroidplatformscreen.cpp
+++ b/src/plugins/platforms/android/qandroidplatformscreen.cpp
@@ -497,7 +497,7 @@ static const int androidLogicalDpi = 72;
QDpi QAndroidPlatformScreen::logicalDpi() const
{
- qreal lDpi = QtAndroid::scaledDensity() * androidLogicalDpi;
+ qreal lDpi = QtAndroid::pixelDensity() * androidLogicalDpi;
return QDpi(lDpi, lDpi);
}