From ae1758d4cdc613c2f451ad1502aceb9973ea042b Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Tue, 31 Aug 2021 22:00:19 +0200 Subject: [PATCH] profile: don't render mobile profile in printmode There is no more reason to render the profile in printMode. DPR is also supported in normal mode. Moreover, don't scale the DPR down by fontScale. If we have to scale down the fonts, we'll have to do this differently without squeezing the rest of the profile features. Signed-off-by: Berthold Stoeger --- profile-widget/profilescene.cpp | 5 ----- profile-widget/qmlprofile.cpp | 4 +--- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/profile-widget/profilescene.cpp b/profile-widget/profilescene.cpp index 16e89afc2..186015378 100644 --- a/profile-widget/profilescene.cpp +++ b/profile-widget/profilescene.cpp @@ -484,7 +484,6 @@ void ProfileScene::plotDive(const struct dive *dIn, int dcIn, DivePlannerPointsM struct gasmix lastgasmix = get_gasmix_at_time(d, get_dive_dc_const(d, dc), duration_t{1}); while (event) { -#ifndef SUBSURFACE_MOBILE // if print mode is selected only draw headings, SP change, gas events or bookmark event if (printMode) { if (empty_string(event->name) || @@ -496,10 +495,6 @@ void ProfileScene::plotDive(const struct dive *dIn, int dcIn, DivePlannerPointsM continue; } } -#else - // printMode is always selected for SUBSURFACE_MOBILE due to font problems - // BUT events are wanted. -#endif if (DiveEventItem::isInteresting(d, currentdc, event, plotInfo)) { auto item = new DiveEventItem(d, event, lastgasmix, plotInfo, timeAxis, profileYAxis, animSpeed, *pixmaps); diff --git a/profile-widget/qmlprofile.cpp b/profile-widget/qmlprofile.cpp index fa4d26c6a..fefb3f097 100644 --- a/profile-widget/qmlprofile.cpp +++ b/profile-widget/qmlprofile.cpp @@ -9,8 +9,6 @@ #include #include -const double fontScale = 0.6; // profile looks less cluttered with smaller font - QMLProfile::QMLProfile(QQuickItem *parent) : QQuickPaintedItem(parent), m_devicePixelRatio(1.0), @@ -33,7 +31,7 @@ QMLProfile::~QMLProfile() void QMLProfile::createProfileView() { - m_profileWidget.reset(new ProfileScene(fontScale * m_devicePixelRatio, true, false)); + m_profileWidget.reset(new ProfileScene(m_devicePixelRatio, false, false)); } // we need this so we can connect update() to the scaleChanged() signal - which the connect above cannot do