diff --git a/backend-shared/exportfuncs.cpp b/backend-shared/exportfuncs.cpp index 35586b2dd..189e86f47 100644 --- a/backend-shared/exportfuncs.cpp +++ b/backend-shared/exportfuncs.cpp @@ -53,7 +53,7 @@ static void exportProfile(ProfileWidget2 *profile, const struct dive *dive, cons static std::unique_ptr getPrintProfile() { auto profile = std::make_unique(nullptr, (double)profileScale, nullptr); - profile->setPrintMode(true); + profile->setPrintMode(); return profile; } diff --git a/desktop-widgets/diveplanner.cpp b/desktop-widgets/diveplanner.cpp index 83aced4bb..87edb59da 100644 --- a/desktop-widgets/diveplanner.cpp +++ b/desktop-widgets/diveplanner.cpp @@ -612,7 +612,7 @@ void PlannerWidgets::printDecoPlan() auto profile = std::make_unique(DivePlannerPointsModel::instance(), 1.0, nullptr); profile->setPlanState(&displayed_dive, 0); profile->plotDive(&displayed_dive, 0, true, true); - profile->setPrintMode(true); + profile->setPrintMode(); profile->draw(&painter, QRect(0, 0, pixmap.width(), pixmap.height())); QByteArray byteArray; diff --git a/desktop-widgets/printer.cpp b/desktop-widgets/printer.cpp index 269867d9a..873e515be 100644 --- a/desktop-widgets/printer.cpp +++ b/desktop-widgets/printer.cpp @@ -113,7 +113,7 @@ void Printer::render(int pages) // apply printing settings to profile profile->setFrameStyle(QFrame::NoFrame); - profile->setPrintMode(true, !printOptions.color_selected); + profile->setPrintMode(!printOptions.color_selected); // render the Qwebview QPainter painter; diff --git a/profile-widget/divecartesianaxis.cpp b/profile-widget/divecartesianaxis.cpp index 1f6f5a81f..9fd8fb9db 100644 --- a/profile-widget/divecartesianaxis.cpp +++ b/profile-widget/divecartesianaxis.cpp @@ -27,9 +27,9 @@ void DiveCartesianAxis::setFontLabelScale(qreal scale) changed = true; } -void DiveCartesianAxis::setPrintMode(bool mode) +void DiveCartesianAxis::setPrintMode() { - printMode = mode; + printMode = true; // update the QPen of all lines depending on printMode QPen newPen = gridPen(); QColor oldColor = pen().brush().color(); diff --git a/profile-widget/divecartesianaxis.h b/profile-widget/divecartesianaxis.h index 253f4e467..efb36fff6 100644 --- a/profile-widget/divecartesianaxis.h +++ b/profile-widget/divecartesianaxis.h @@ -31,7 +31,7 @@ public: }; DiveCartesianAxis(double fontPrintScale, ProfileScene &scene); ~DiveCartesianAxis(); - void setPrintMode(bool mode); + void setPrintMode(); void setMinimum(double minimum); void setMaximum(double maximum); void setTickInterval(double interval); diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp index dda0f0a29..b80d35a82 100644 --- a/profile-widget/profilewidget2.cpp +++ b/profile-widget/profilewidget2.cpp @@ -1262,25 +1262,25 @@ void ProfileWidget2::changeGas(int tank, int seconds) } #endif -void ProfileWidget2::setPrintMode(bool mode, bool grayscale) +void ProfileWidget2::setPrintMode(bool grayscale) { - printMode = mode; + printMode = true; resetZoom(); // set printMode for axes - profileScene->profileYAxis->setPrintMode(mode); - profileScene->gasYAxis->setPrintMode(mode); - profileScene->temperatureAxis->setPrintMode(mode); - profileScene->timeAxis->setPrintMode(mode); - profileScene->cylinderPressureAxis->setPrintMode(mode); - isGrayscale = mode ? grayscale : false; + profileScene->profileYAxis->setPrintMode(); + profileScene->gasYAxis->setPrintMode(); + profileScene->temperatureAxis->setPrintMode(); + profileScene->timeAxis->setPrintMode(); + profileScene->cylinderPressureAxis->setPrintMode(); + isGrayscale = grayscale; #ifndef SUBSURFACE_MOBILE - profileScene->heartBeatAxis->setPrintMode(mode); - profileScene->percentageAxis->setPrintMode(mode); + profileScene->heartBeatAxis->setPrintMode(); + profileScene->percentageAxis->setPrintMode(); - mouseFollowerHorizontal->setVisible(!mode); - mouseFollowerVertical->setVisible(!mode); - toolTipItem->setVisible(!mode); + mouseFollowerHorizontal->setVisible(false); + mouseFollowerVertical->setVisible(false); + toolTipItem->setVisible(false); #endif } diff --git a/profile-widget/profilewidget2.h b/profile-widget/profilewidget2.h index 104d4e915..764b4f167 100644 --- a/profile-widget/profilewidget2.h +++ b/profile-widget/profilewidget2.h @@ -70,7 +70,7 @@ public: void setProfileState(const struct dive *d, int dc); void setPlanState(const struct dive *d, int dc); void setEditState(const struct dive *d, int dc); - void setPrintMode(bool mode, bool grayscale = false); + void setPrintMode(bool grayscale = false); bool isPlanner() const; void draw(QPainter *painter, const QRect &pos); QImage toImage(QSize size); diff --git a/profile-widget/qmlprofile.cpp b/profile-widget/qmlprofile.cpp index 24c57caa7..d3907db1f 100644 --- a/profile-widget/qmlprofile.cpp +++ b/profile-widget/qmlprofile.cpp @@ -30,7 +30,7 @@ void QMLProfile::createProfileView() { m_profileWidget.reset(new ProfileWidget2(nullptr, fontScale * m_devicePixelRatio, nullptr)); m_profileWidget->setProfileState(nullptr, 0); - m_profileWidget->setPrintMode(true); + m_profileWidget->setPrintMode(); } // we need this so we can connect update() to the scaleChanged() signal - which the connect above cannot do