mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-12 21:10:01 -08:00
Added highlight for unavailable games
This commit is contained in:
parent
93cf7dbaaf
commit
0ac3da40e2
1 changed files with 3 additions and 1 deletions
|
|
@ -79,12 +79,14 @@ QVariant GamesModel::data(const QModelIndex &index, int role) const
|
||||||
return QVariant();
|
return QVariant();
|
||||||
if (role == Qt::UserRole)
|
if (role == Qt::UserRole)
|
||||||
return index.row();
|
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();
|
return QVariant();
|
||||||
if ((index.row() >= gameList.size()) || (index.column() >= columnCount()))
|
if ((index.row() >= gameList.size()) || (index.column() >= columnCount()))
|
||||||
return QVariant();
|
return QVariant();
|
||||||
|
|
||||||
const ServerInfo_Game &g = gameList[index.row()];
|
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()) {
|
switch (index.column()) {
|
||||||
case ROOM:
|
case ROOM:
|
||||||
return rooms.value(g.room_id());
|
return rooms.value(g.room_id());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue