mirror of
https://github.com/subsurface/subsurface.git
synced 2024-12-11 03:21:29 +00:00
Printing: use more appropriate font sizes
2-up and 6-up need different fonts. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
a4d1163d21
commit
2552b027ae
3 changed files with 9 additions and 1 deletions
|
@ -1854,6 +1854,11 @@ void ProfilePrintModel::setDive(struct dive *divePtr)
|
||||||
// reset();
|
// reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ProfilePrintModel::setFontsize(double size)
|
||||||
|
{
|
||||||
|
fontSize = size;
|
||||||
|
}
|
||||||
|
|
||||||
int ProfilePrintModel::rowCount(const QModelIndex &parent) const
|
int ProfilePrintModel::rowCount(const QModelIndex &parent) const
|
||||||
{
|
{
|
||||||
return 12;
|
return 12;
|
||||||
|
@ -1967,7 +1972,7 @@ QVariant ProfilePrintModel::data(const QModelIndex &index, int role) const
|
||||||
}
|
}
|
||||||
case Qt::FontRole: {
|
case Qt::FontRole: {
|
||||||
QFont font;
|
QFont font;
|
||||||
font.setPointSize(6);
|
font.setPointSizeF(fontSize);
|
||||||
if (row == 0 && col == 0) {
|
if (row == 0 && col == 0) {
|
||||||
font.setBold(true);
|
font.setBold(true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -380,6 +380,7 @@ class ProfilePrintModel : public QAbstractTableModel {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int diveId;
|
int diveId;
|
||||||
|
double fontSize;
|
||||||
QString truncateString(char *str, const int maxlen) const;
|
QString truncateString(char *str, const int maxlen) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -388,6 +389,7 @@ public:
|
||||||
int columnCount(const QModelIndex &parent = QModelIndex()) const;
|
int columnCount(const QModelIndex &parent = QModelIndex()) const;
|
||||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
|
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
|
||||||
void setDive(struct dive *divePtr);
|
void setDive(struct dive *divePtr);
|
||||||
|
void setFontsize(double size);
|
||||||
};
|
};
|
||||||
|
|
||||||
class GasSelectionModel : public QStringListModel {
|
class GasSelectionModel : public QStringListModel {
|
||||||
|
|
|
@ -166,6 +166,7 @@ void PrintLayout::printProfileDives(int divesPerRow, int divesPerColumn)
|
||||||
const int padPT = 5;
|
const int padPT = 5;
|
||||||
// create a model and table
|
// create a model and table
|
||||||
ProfilePrintModel model;
|
ProfilePrintModel model;
|
||||||
|
model.setFontsize(divesPerColumn == 1 ? 6.5 : 4.5);
|
||||||
QPointer<QTableView> table(createProfileTable(&model, scaledW));
|
QPointer<QTableView> table(createProfileTable(&model, scaledW));
|
||||||
// profilePrintTableMaxH updates after the table is created
|
// profilePrintTableMaxH updates after the table is created
|
||||||
const int tableH = profilePrintTableMaxH;
|
const int tableH = profilePrintTableMaxH;
|
||||||
|
|
Loading…
Reference in a new issue