diff options
author | Lubomir I. Ivanov <neolit123@gmail.com> | 2013-10-05 13:31:08 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-10-07 09:29:40 -0700 |
commit | edd2db688619aedf5efb10c231593591c963fc0f (patch) | |
tree | 004beb39518ad32477c122234c005c30deac3a56 | |
parent | 8ba5423e65b59163080c5ccee8e40d0c5e5a42b6 (diff) | |
download | subsurface-edd2db688619aedf5efb10c231593591c963fc0f.tar.gz |
Print: allow optional table on top of profile
Patch enables the 'Profile on top' / 'Notes on top'
functionality in the print options dialog.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | qt-ui/printlayout.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/qt-ui/printlayout.cpp b/qt-ui/printlayout.cpp index 8224c916b..3ddc02aa3 100644 --- a/qt-ui/printlayout.cpp +++ b/qt-ui/printlayout.cpp @@ -139,6 +139,12 @@ void PrintLayout::printProfileDives(int divesPerRow, int divesPerColumn) const int tableH = profilePrintTableMaxH; // resize the profile widget profile->resize(scaledW, scaledH - tableH - padPT); + // offset table or profile on top + int yOffsetProfile = 0, yOffsetTable = 0; + if (printOptions->notes_up) + yOffsetProfile = tableH + padPT; + else + yOffsetTable = scaledH - tableH; // plot the dives at specific rows and columns on the page int i, row = 0, col = 0; @@ -158,13 +164,13 @@ void PrintLayout::printProfileDives(int divesPerRow, int divesPerColumn) profile->plot(dive, true); QPixmap profilePm = QPixmap::grabWidget(profile); // Qt4 painter.drawPixmap((scaledW + padW) * col, - (scaledH + padH) * row, + (scaledH + padH) * row + yOffsetProfile, profilePm); // draw a table model.setDive(dive); QPixmap tablePm = QPixmap::grabWidget(table); // Qt4 painter.drawPixmap((scaledW + padW) * col, - (scaledH + padH) * row + (scaledH - tableH), + (scaledH + padH) * row + yOffsetTable, tablePm); col++; } |