Add const to the colors and extra name for green color
This commit is contained in:
parent
a50f6597c2
commit
99b52a7a3c
1 changed files with 6 additions and 5 deletions
|
@ -202,9 +202,10 @@ public:
|
||||||
case Qt::ForegroundRole: {
|
case Qt::ForegroundRole: {
|
||||||
auto members = data(MemberListRole).toList();
|
auto members = data(MemberListRole).toList();
|
||||||
auto max_players = data(MaxPlayerRole).toInt();
|
auto max_players = data(MaxPlayerRole).toInt();
|
||||||
QColor room_full_color(255, 48, 32);
|
const QColor room_full_color(255, 48, 32);
|
||||||
QColor room_almost_full_color(255, 140, 32);
|
const QColor room_almost_full_color(255, 140, 32);
|
||||||
QColor room_empty_color(128, 128, 128);
|
const QColor room_has_players_color(32, 160, 32);
|
||||||
|
const QColor room_empty_color(128, 128, 128);
|
||||||
|
|
||||||
if (members.size() >= max_players) {
|
if (members.size() >= max_players) {
|
||||||
return QBrush(room_full_color);
|
return QBrush(room_full_color);
|
||||||
|
@ -212,8 +213,8 @@ public:
|
||||||
return QBrush(room_almost_full_color);
|
return QBrush(room_almost_full_color);
|
||||||
} else if (members.size() == 0) {
|
} else if (members.size() == 0) {
|
||||||
return QBrush(room_empty_color);
|
return QBrush(room_empty_color);
|
||||||
} else if (members.size() > 0 && members.size() < max_players - 1) {
|
} else if (members.size() > 0 && members.size() < (max_players - 1)) {
|
||||||
return QBrush(QColor(32, 160, 32));
|
return QBrush(room_has_players_color);
|
||||||
}
|
}
|
||||||
// FIXME: How to return a value that tells Qt not to modify the
|
// FIXME: How to return a value that tells Qt not to modify the
|
||||||
// text color from the default (as if Qt::ForegroundRole wasn't overridden)?
|
// text color from the default (as if Qt::ForegroundRole wasn't overridden)?
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue