mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Merge branch 'tomaz-css' into Qt
Tomaz' code does a much better job of shading the dive list! Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
commit
ff2ce39970
10 changed files with 106 additions and 16 deletions
|
@ -490,12 +490,18 @@ QVariant DiveItem::data(int column, int role) const
|
|||
case LOCATION:
|
||||
retVal = QString(dive->location);
|
||||
break;
|
||||
case RATING:
|
||||
retVal = dive->rating;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if(role == STAR_ROLE){
|
||||
retVal = dive->rating;
|
||||
}
|
||||
|
||||
if(role == DIVE_ROLE){
|
||||
retVal = QVariant::fromValue<void*>(dive);
|
||||
}
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
@ -601,9 +607,6 @@ QVariant DiveTripModel::data(const QModelIndex& index, int role) const
|
|||
if (!index.isValid())
|
||||
return QVariant();
|
||||
|
||||
if (role == Qt::BackgroundRole)
|
||||
return QBrush(QColor(index.row() % 2 ? Qt::white : QColor(Qt::lightGray).lighter(120)));
|
||||
|
||||
TreeItemDT* item = static_cast<TreeItemDT*>(index.internalPointer());
|
||||
|
||||
return item->data(index.column(), role);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue