diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-05-02 14:19:15 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-05-02 14:52:26 -0700 |
commit | 021ef8ad09295a0ad4b5a3450a651637eea8672d (patch) | |
tree | 1daa2b476a2ed711f84c30b327321ef4e77e22f3 /qt-ui/models.cpp | |
parent | c4e2c322a3f6505880b9330e577129e0110ed2ba (diff) | |
download | subsurface-021ef8ad09295a0ad4b5a3450a651637eea8672d.tar.gz |
Alternate background colors for dive list
This was written with massive hand-holding by Tomaz - actually, this was
mostly proposed via IRC by Tomaz and then implemented by me...
Right now because of the list-of-lists nature of the model we have the
small issue that every trip starts with a dark background dive, even if
the trip itself has a dark background.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/models.cpp')
-rw-r--r-- | qt-ui/models.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp index 5c7fc7a8b..373770404 100644 --- a/qt-ui/models.cpp +++ b/qt-ui/models.cpp @@ -7,6 +7,8 @@ #include "models.h" #include <QCoreApplication> #include <QDebug> +#include <QColor> +#include <QBrush> extern struct tank_info tank_info[100]; @@ -599,6 +601,8 @@ 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()); |