diff options
Diffstat (limited to 'qt-ui/profile')
-rw-r--r-- | qt-ui/profile/divecartesianaxis.cpp | 3 | ||||
-rw-r--r-- | qt-ui/profile/divetextitem.cpp | 5 | ||||
-rw-r--r-- | qt-ui/profile/profilewidget2.cpp | 21 | ||||
-rw-r--r-- | qt-ui/profile/profilewidget2.h | 4 |
4 files changed, 29 insertions, 4 deletions
diff --git a/qt-ui/profile/divecartesianaxis.cpp b/qt-ui/profile/divecartesianaxis.cpp index 4c4f15bb2..0d1d5357d 100644 --- a/qt-ui/profile/divecartesianaxis.cpp +++ b/qt-ui/profile/divecartesianaxis.cpp @@ -5,6 +5,7 @@ #include "preferences.h" #include "diveplotdatamodel.h" #include "animationfunctions.h" +#include "mainwindow.h" #include <QPen> #include <QGraphicsScene> #include <QDebug> @@ -132,7 +133,7 @@ void emptyList(QList<T *> &list, double steps) void DiveCartesianAxis::updateTicks(color_indice_t color) { - if (!scene() || !changed) + if (!scene() || (!changed && !MainWindow::instance()->graphics()->getPrintMode())) return; QLineF m = line(); // unused so far: diff --git a/qt-ui/profile/divetextitem.cpp b/qt-ui/profile/divetextitem.cpp index 582cc4070..4d8687626 100644 --- a/qt-ui/profile/divetextitem.cpp +++ b/qt-ui/profile/divetextitem.cpp @@ -1,5 +1,6 @@ #include "divetextitem.h" #include "animationfunctions.h" +#include "mainwindow.h" #include <QPropertyAnimation> #include <QApplication> @@ -61,11 +62,11 @@ void DiveTextItem::updateText() QFont fnt(qApp->font()); if ((size = fnt.pixelSize()) > 0) { // set in pixels - so the scale factor may not make a difference if it's too close to 1 - size *= scale; + size *= scale * MainWindow::instance()->graphics()->getFontPrintScale(); fnt.setPixelSize(size); } else { size = fnt.pointSizeF(); - size *= scale; + size *= scale * MainWindow::instance()->graphics()->getFontPrintScale();; fnt.setPointSizeF(size); } QFontMetrics fm(fnt); diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index 5b190dfba..ee80d59bd 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -90,7 +90,8 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) : QGraphicsView(parent), isGrayscale(false), printMode(false), shouldCalculateMaxTime(true), - shouldCalculateMaxDepth(true) + shouldCalculateMaxDepth(true), + fontPrintScale(1.0) { memset(&plotInfo, 0, sizeof(plotInfo)); @@ -1054,12 +1055,30 @@ void ProfileWidget2::changeGas() replot(); } +bool ProfileWidget2::getPrintMode() +{ + return printMode; +} + void ProfileWidget2::setPrintMode(bool mode, bool grayscale) { printMode = mode; isGrayscale = mode ? grayscale : false; } +void ProfileWidget2::setFontPrintScale(double scale) +{ + fontPrintScale = scale; +} + +double ProfileWidget2::getFontPrintScale() +{ + if (printMode) + return fontPrintScale; + else + return 1.0; +} + void ProfileWidget2::editName() { QAction *action = qobject_cast<QAction *>(sender()); diff --git a/qt-ui/profile/profilewidget2.h b/qt-ui/profile/profilewidget2.h index 2d9e921f0..bcde4a23a 100644 --- a/qt-ui/profile/profilewidget2.h +++ b/qt-ui/profile/profilewidget2.h @@ -71,9 +71,12 @@ public: virtual bool eventFilter(QObject *, QEvent *); void setupItem(AbstractProfilePolygonItem *item, DiveCartesianAxis *hAxis, DiveCartesianAxis *vAxis, DivePlotDataModel *model, int vData, int hData, int zValue); void setPrintMode(bool mode, bool grayscale = false); + bool getPrintMode(); bool isPointOutOfBoundaries(const QPointF &point) const; bool isPlanner(); bool isAddOrPlanner(); + double getFontPrintScale(); + void setFontPrintScale(double scale); State currentState; public @@ -174,6 +177,7 @@ private: bool shouldCalculateMaxDepth; int maxtime; int maxdepth; + double fontPrintScale; }; #endif // PROFILEWIDGET2_H |