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 <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2022-03-12 16:35:56 -08:00
parent 69cb33fd2e
commit c2a7382b10
2 changed files with 1 additions and 7 deletions

View file

@ -20,13 +20,7 @@ DivePixmaps::DivePixmaps(int dpr) : dpr(dpr)
extern int verbose; extern int verbose;
double dprf = dpr / 100.0; double dprf = dpr / 100.0;
const IconMetrics &metrics = defaultIconMetrics(); const IconMetrics &metrics = defaultIconMetrics();
#ifndef SUBSURFACE_MOBILE
int sz_bigger = metrics.sz_med + metrics.sz_small; // ex 40px 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); sz_bigger = lrint(sz_bigger * dprf);
int sz_pix = sz_bigger / 2; // ex 20px int sz_pix = sz_bigger / 2; // ex 20px
if (verbose) if (verbose)

View file

@ -31,7 +31,7 @@ QMLProfile::~QMLProfile()
void QMLProfile::createProfileView() 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 // we need this so we can connect update() to the scaleChanged() signal - which the connect above cannot do