Printing: change the header to show depth / duration
At least for my dives there wasn't enough space for depth and duration in the header, most likely because I made the last two columns smaller to create more space for tags and suit. With this commit the depth and doration in the header now spans two columns and easily fits. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
6699dab952
commit
0d9a1946fa
@ -1886,7 +1886,7 @@ QVariant ProfilePrintModel::data(const QModelIndex &index, int role) const
|
||||
if (row == 0) {
|
||||
if (col == 0)
|
||||
return tr("Dive #%1 - %2").arg(dive->number).arg(di.displayDate());
|
||||
if (col == 4) {
|
||||
if (col == 3) {
|
||||
QString unit = (get_units()->length == units::METERS) ? "m" : "ft";
|
||||
return tr("Max depth: %1 %2").arg(di.displayDepth()).arg(unit);
|
||||
}
|
||||
@ -1894,7 +1894,7 @@ QVariant ProfilePrintModel::data(const QModelIndex &index, int role) const
|
||||
if (row == 1) {
|
||||
if (col == 0)
|
||||
return QString(dive->location);
|
||||
if (col == 4)
|
||||
if (col == 3)
|
||||
return QString(tr("Duration: %1 min")).arg(di.displayDuration());
|
||||
}
|
||||
// headings
|
||||
|
||||
@ -252,8 +252,10 @@ QTableView *PrintLayout::createProfileTable(ProfilePrintModel *model, const int
|
||||
const int cols = model->columnCount();
|
||||
const int rows = model->rowCount();
|
||||
// info on top
|
||||
table->setSpan(0, 0, 1, 4);
|
||||
table->setSpan(1, 0, 1, 4);
|
||||
table->setSpan(0, 0, 1, 3);
|
||||
table->setSpan(1, 0, 1, 3);
|
||||
table->setSpan(0, 3, 1, 2);
|
||||
table->setSpan(1, 3, 1, 2);
|
||||
// gas used
|
||||
table->setSpan(2, 0, 1, 2);
|
||||
table->setSpan(3, 0, 1, 2);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user