mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-01 07:23:23 +00:00
Print: adjustments to font sizes and alignment
The new profile table requires different alignment and different font sizes for specific cells. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
parent
f85b434ef1
commit
a60475d336
2 changed files with 9 additions and 11 deletions
|
@ -1717,17 +1717,17 @@ QVariant ProfilePrintModel::data(const QModelIndex &index, int role) const
|
||||||
}
|
}
|
||||||
// dive location
|
// dive location
|
||||||
if (row == 1 && col == 0) {
|
if (row == 1 && col == 0) {
|
||||||
font.setPixelSize(baseSize);
|
|
||||||
font.setBold(true);
|
font.setBold(true);
|
||||||
|
font.setPixelSize(baseSize);
|
||||||
return QVariant::fromValue(font);
|
return QVariant::fromValue(font);
|
||||||
}
|
}
|
||||||
// depth/duration
|
// depth/duration
|
||||||
if ((row == 0 || row == 1) && col == 5) {
|
if ((row == 0 || row == 1) && col == 4) {
|
||||||
font.setPixelSize(baseSize);
|
font.setPixelSize(baseSize);
|
||||||
return QVariant::fromValue(font);
|
return QVariant::fromValue(font);
|
||||||
}
|
}
|
||||||
// notes
|
// notes
|
||||||
if (row == 9 && col == 0) {
|
if (row > 5 && col == 0) {
|
||||||
font.setPixelSize(baseSize + 1);
|
font.setPixelSize(baseSize + 1);
|
||||||
return QVariant::fromValue(font);
|
return QVariant::fromValue(font);
|
||||||
}
|
}
|
||||||
|
@ -1735,12 +1735,10 @@ QVariant ProfilePrintModel::data(const QModelIndex &index, int role) const
|
||||||
return QVariant::fromValue(font);
|
return QVariant::fromValue(font);
|
||||||
}
|
}
|
||||||
case Qt::TextAlignmentRole: {
|
case Qt::TextAlignmentRole: {
|
||||||
unsigned int align = Qt::AlignCenter;
|
// everything is aligned to the left
|
||||||
// dive #, location, notes
|
unsigned int align = Qt::AlignLeft;
|
||||||
if ((row < 2 || row == 10) && col == 0)
|
// align depth and duration right
|
||||||
align = Qt::AlignLeft | Qt::AlignVCenter;
|
if (row < 2 && col == 4)
|
||||||
// depth, duration
|
|
||||||
if (row < 2 && col == 5)
|
|
||||||
align = Qt::AlignRight | Qt::AlignVCenter;
|
align = Qt::AlignRight | Qt::AlignVCenter;
|
||||||
return QVariant::fromValue(align);
|
return QVariant::fromValue(align);
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,9 +42,9 @@ PrintLayout::PrintLayout(PrintDialog *dialogPtr, QPrinter *printerPtr, struct op
|
||||||
profilePrintColumnWidths.append(dw);
|
profilePrintColumnWidths.append(dw);
|
||||||
profilePrintColumnWidths.append(dw);
|
profilePrintColumnWidths.append(dw);
|
||||||
profilePrintColumnWidths.append(dw); // fit to 100%
|
profilePrintColumnWidths.append(dw); // fit to 100%
|
||||||
const int sr = 9; // smallest row height in pixels
|
const int sr = 10; // smallest row height in pixels
|
||||||
profilePrintRowHeights.append(sr + 2);
|
profilePrintRowHeights.append(sr + 2);
|
||||||
profilePrintRowHeights.append(sr + 7);
|
profilePrintRowHeights.append(sr + 5);
|
||||||
profilePrintRowHeights.append(sr);
|
profilePrintRowHeights.append(sr);
|
||||||
profilePrintRowHeights.append(sr);
|
profilePrintRowHeights.append(sr);
|
||||||
profilePrintRowHeights.append(sr);
|
profilePrintRowHeights.append(sr);
|
||||||
|
|
Loading…
Add table
Reference in a new issue