From 0ac3da40e2c4ec02070562905306aabab4dfdfbc Mon Sep 17 00:00:00 2001 From: Matt Lowe Date: Tue, 27 Jan 2015 14:24:46 +0100 Subject: [PATCH] Added highlight for unavailable games --- cockatrice/src/gamesmodel.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cockatrice/src/gamesmodel.cpp b/cockatrice/src/gamesmodel.cpp index 1ef81e164..5575e0511 100644 --- a/cockatrice/src/gamesmodel.cpp +++ b/cockatrice/src/gamesmodel.cpp @@ -79,12 +79,14 @@ QVariant GamesModel::data(const QModelIndex &index, int role) const return QVariant(); if (role == Qt::UserRole) return index.row(); - if (role != Qt::DisplayRole && role != SORT_ROLE && role != Qt::DecorationRole && role != Qt::TextAlignmentRole) + if (role != Qt::DisplayRole && role != SORT_ROLE && role != Qt::DecorationRole && role != Qt::TextAlignmentRole && role != Qt::BackgroundRole) return QVariant(); if ((index.row() >= gameList.size()) || (index.column() >= columnCount())) return QVariant(); const ServerInfo_Game &g = gameList[index.row()]; + if (role == Qt::BackgroundRole && (g.player_count() == g.max_players())) + return QColor(230, 190, 200); switch (index.column()) { case ROOM: return rooms.value(g.room_id());