From c2a7382b10822395c09e3d0af1206a66b7f93058 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 12 Mar 2022 16:35:56 -0800 Subject: [PATCH] mobile: better scaling of profile items With all the recent changes, some of the previous assumptions about the scale of items seem to be no longer appropriate. Now that we are showing the icons in the profile again on device it's quite obvious that they were way too big - clearly we don't need the special scaling anymore. Also implement a suggestion from Berthold to get slightly smaller fonts and finer structures in the profile on mobile devices. This scaling of the DPR seems to work well in my tests. Signed-off-by: Dirk Hohndel --- profile-widget/divepixmapcache.cpp | 6 ------ profile-widget/qmlprofile.cpp | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/profile-widget/divepixmapcache.cpp b/profile-widget/divepixmapcache.cpp index 37c6146ae..d59116022 100644 --- a/profile-widget/divepixmapcache.cpp +++ b/profile-widget/divepixmapcache.cpp @@ -20,13 +20,7 @@ DivePixmaps::DivePixmaps(int dpr) : dpr(dpr) extern int verbose; double dprf = dpr / 100.0; const IconMetrics &metrics = defaultIconMetrics(); -#ifndef SUBSURFACE_MOBILE int sz_bigger = metrics.sz_med + metrics.sz_small; // ex 40px -#else - // SUBSURFACE_MOBILE, seems a little big from the code, - // but looks fine on device - int sz_bigger = metrics.sz_big + metrics.sz_med; -#endif sz_bigger = lrint(sz_bigger * dprf); int sz_pix = sz_bigger / 2; // ex 20px if (verbose) diff --git a/profile-widget/qmlprofile.cpp b/profile-widget/qmlprofile.cpp index a47eb0e3a..35c720967 100644 --- a/profile-widget/qmlprofile.cpp +++ b/profile-widget/qmlprofile.cpp @@ -31,7 +31,7 @@ QMLProfile::~QMLProfile() void QMLProfile::createProfileView() { - m_profileWidget.reset(new ProfileScene(m_devicePixelRatio, false, false)); + m_profileWidget.reset(new ProfileScene(m_devicePixelRatio * 0.8, false, false)); } // we need this so we can connect update() to the scaleChanged() signal - which the connect above cannot do