diff options
| author | 2024-02-10 01:45:11 +0100 | |
|---|---|---|
| committer | 2024-02-09 18:45:11 -0600 | |
| commit | fe6934593fd7e7b6c61d1fb84d0794d19f024b47 (patch) | |
| tree | b3a890d81fe4c9ce94cc42126f56a8e8fa50437e | |
| parent | Merge pull request #12951 from liamwhite/more-ipc (diff) | |
| download | yuzu-fe6934593fd7e7b6c61d1fb84d0794d19f024b47.tar.gz yuzu-fe6934593fd7e7b6c61d1fb84d0794d19f024b47.tar.xz yuzu-fe6934593fd7e7b6c61d1fb84d0794d19f024b47.zip | |
Fix multiplayer player count color in dark themes | Temp fix until #12744: Add green color for counts > 0 and < max_players - 1 (#12930)
* fix intended player count color in dark themes
* Refactor
* Change to green color for white and dark themes
* Add const to the colors and extra name for green color
Diffstat (limited to '')
| -rw-r--r-- | src/yuzu/multiplayer/lobby_p.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/yuzu/multiplayer/lobby_p.h b/src/yuzu/multiplayer/lobby_p.h index 398833e7a..77ec1fcde 100644 --- a/src/yuzu/multiplayer/lobby_p.h +++ b/src/yuzu/multiplayer/lobby_p.h | |||
| @@ -202,12 +202,19 @@ public: | |||
| 202 | case Qt::ForegroundRole: { | 202 | case Qt::ForegroundRole: { |
| 203 | auto members = data(MemberListRole).toList(); | 203 | auto members = data(MemberListRole).toList(); |
| 204 | auto max_players = data(MaxPlayerRole).toInt(); | 204 | auto max_players = data(MaxPlayerRole).toInt(); |
| 205 | const QColor room_full_color(255, 48, 32); | ||
| 206 | const QColor room_almost_full_color(255, 140, 32); | ||
| 207 | const QColor room_has_players_color(32, 160, 32); | ||
| 208 | const QColor room_empty_color(128, 128, 128); | ||
| 209 | |||
| 205 | if (members.size() >= max_players) { | 210 | if (members.size() >= max_players) { |
| 206 | return QBrush(QColor(255, 48, 32)); | 211 | return QBrush(room_full_color); |
| 207 | } else if (members.size() == (max_players - 1)) { | 212 | } else if (members.size() == (max_players - 1)) { |
| 208 | return QBrush(QColor(255, 140, 32)); | 213 | return QBrush(room_almost_full_color); |
| 209 | } else if (members.size() == 0) { | 214 | } else if (members.size() == 0) { |
| 210 | return QBrush(QColor(128, 128, 128)); | 215 | return QBrush(room_empty_color); |
| 216 | } else if (members.size() > 0 && members.size() < (max_players - 1)) { | ||
| 217 | return QBrush(room_has_players_color); | ||
| 211 | } | 218 | } |
| 212 | // FIXME: How to return a value that tells Qt not to modify the | 219 | // FIXME: How to return a value that tells Qt not to modify the |
| 213 | // text color from the default (as if Qt::ForegroundRole wasn't overridden)? | 220 | // text color from the default (as if Qt::ForegroundRole wasn't overridden)? |