aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/models.cpp
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2013-11-30 15:41:18 +0200
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2013-11-30 15:41:18 +0200
commita60475d336abae3f1f672443dc5bb8a13395a830 (patch)
tree96a95ac7959e3728d752f8840a7c78f7d1830b73 /qt-ui/models.cpp
parentf85b434ef1fd58e559a68ab2f4e3fbc20e98dd46 (diff)
downloadsubsurface-a60475d336abae3f1f672443dc5bb8a13395a830.tar.gz
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>
Diffstat (limited to 'qt-ui/models.cpp')
-rw-r--r--qt-ui/models.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp
index 726a56914..ead8abc57 100644
--- a/qt-ui/models.cpp
+++ b/qt-ui/models.cpp
@@ -1717,17 +1717,17 @@ QVariant ProfilePrintModel::data(const QModelIndex &index, int role) const
}
// dive location
if (row == 1 && col == 0) {
- font.setPixelSize(baseSize);
font.setBold(true);
+ font.setPixelSize(baseSize);
return QVariant::fromValue(font);
}
// depth/duration
- if ((row == 0 || row == 1) && col == 5) {
+ if ((row == 0 || row == 1) && col == 4) {
font.setPixelSize(baseSize);
return QVariant::fromValue(font);
}
// notes
- if (row == 9 && col == 0) {
+ if (row > 5 && col == 0) {
font.setPixelSize(baseSize + 1);
return QVariant::fromValue(font);
}
@@ -1735,12 +1735,10 @@ QVariant ProfilePrintModel::data(const QModelIndex &index, int role) const
return QVariant::fromValue(font);
}
case Qt::TextAlignmentRole: {
- unsigned int align = Qt::AlignCenter;
- // dive #, location, notes
- if ((row < 2 || row == 10) && col == 0)
- align = Qt::AlignLeft | Qt::AlignVCenter;
- // depth, duration
- if (row < 2 && col == 5)
+ // everything is aligned to the left
+ unsigned int align = Qt::AlignLeft;
+ // align depth and duration right
+ if (row < 2 && col == 4)
align = Qt::AlignRight | Qt::AlignVCenter;
return QVariant::fromValue(align);
}