diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2016-03-28 16:43:40 -0500 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-03-28 17:05:29 -0500 |
commit | dd0d88f9d74975bf9ee84dcf2e18948d2680356d (patch) | |
tree | 7718e4d277aa792ba415c1496415858ad51cea4f /profile-widget/diveeventitem.cpp | |
parent | 8185d24e610e5655da8ccbcfcc4411ea2215fc1f (diff) | |
download | subsurface-dd0d88f9d74975bf9ee84dcf2e18948d2680356d.tar.gz |
QML UI: take device pixel ratio into account when scaling pixmaps on iOS
This way warning icons and tank change icons and other event markers are no
longer ridiculously tiny on retina screens. Oddly this doesn't appear to be
needed on Android, only on iOS.
Fixes #1033
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'profile-widget/diveeventitem.cpp')
-rw-r--r-- | profile-widget/diveeventitem.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/profile-widget/diveeventitem.cpp b/profile-widget/diveeventitem.cpp index b2e3db8c9..3e1de48f3 100644 --- a/profile-widget/diveeventitem.cpp +++ b/profile-widget/diveeventitem.cpp @@ -66,8 +66,13 @@ void DiveEventItem::setupPixmap() #ifndef SUBSURFACE_MOBILE int sz_bigger = metrics.sz_med + metrics.sz_small; // ex 40px #else +#if defined(Q_OS_IOS) + // on iOS devices we need to adjust for Device Pixel Ratio + int sz_bigger = metrics.sz_med * metrics.dpr; +#else int sz_bigger = metrics.sz_med; #endif +#endif int sz_pix = sz_bigger/2; // ex 20px #define EVENT_PIXMAP(PIX) QPixmap(QString(PIX)).scaled(sz_pix, sz_pix, Qt::KeepAspectRatio, Qt::SmoothTransformation) |