mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Improve readability of yearly statistics
Make the entries for years bold, keep the months non-bold. It's still a sea of data, but this is an improvement. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
07a16574e9
commit
138a00bd10
3 changed files with 15 additions and 6 deletions
|
@ -822,12 +822,13 @@ QVariant TreeModel::data(const QModelIndex& index, int role) const
|
|||
if (!index.isValid())
|
||||
return QVariant();
|
||||
|
||||
if (role == Qt::FontRole) {
|
||||
return defaultModelFont();
|
||||
}
|
||||
TreeItem* item = static_cast<TreeItem*>(index.internalPointer());
|
||||
QVariant val = item->data(index.column(), role);
|
||||
|
||||
return item->data(index.column(), role);
|
||||
if (role == Qt::FontRole && !val.isValid())
|
||||
return defaultModelFont();
|
||||
else
|
||||
return val;
|
||||
}
|
||||
|
||||
QModelIndex TreeModel::index(int row, int column, const QModelIndex& parent)
|
||||
|
@ -1309,9 +1310,14 @@ QVariant YearStatisticsItem::data(int column, int role) const
|
|||
{
|
||||
double value;
|
||||
QVariant ret;
|
||||
if (role != Qt::DisplayRole)
|
||||
return ret;
|
||||
|
||||
if (role == Qt::FontRole) {
|
||||
QFont font = defaultModelFont();
|
||||
font.setBold(stats_interval.is_year);
|
||||
return font;
|
||||
} else if (role != Qt::DisplayRole) {
|
||||
return ret;
|
||||
}
|
||||
switch(column) {
|
||||
case YEAR: ret = stats_interval.period; break;
|
||||
case DIVES: ret = stats_interval.selection_size; break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue