From 62578c86393c196f5a7622e73e7ac32b50fed737 Mon Sep 17 00:00:00 2001 From: Kevnkkm Date: Tue, 6 Feb 2024 02:10:05 +0100 Subject: [PATCH] fix intended player count color in dark themes --- src/yuzu/multiplayer/lobby_p.h | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/src/yuzu/multiplayer/lobby_p.h b/src/yuzu/multiplayer/lobby_p.h index 398833e7a1..0dff542890 100644 --- a/src/yuzu/multiplayer/lobby_p.h +++ b/src/yuzu/multiplayer/lobby_p.h @@ -202,12 +202,26 @@ public: case Qt::ForegroundRole: { auto members = data(MemberListRole).toList(); auto max_players = data(MaxPlayerRole).toInt(); - if (members.size() >= max_players) { - return QBrush(QColor(255, 48, 32)); - } else if (members.size() == (max_players - 1)) { - return QBrush(QColor(255, 140, 32)); - } else if (members.size() == 0) { - return QBrush(QColor(128, 128, 128)); + + if (QIcon::themeName().contains(QStringLiteral("dark")) || + QIcon::themeName().contains(QStringLiteral("midnight"))) { + if (members.size() >= max_players) { + return QBrush(QColor(255, 48, 32)); + } else if (members.size() == (max_players - 1)) { + return QBrush(QColor(255, 140, 32)); + } else if (members.size() == 0) { + return QBrush(QColor(128, 128, 128)); + } else if (members.size() > 0 && members.size() < max_players - 1) { + return QBrush(QColor(204, 204, 204)); + } + } else { + if (members.size() >= max_players) { + return QBrush(QColor(255, 48, 32)); + } else if (members.size() == (max_players - 1)) { + return QBrush(QColor(255, 140, 32)); + } else if (members.size() == 0) { + return QBrush(QColor(128, 128, 128)); + } } // 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)?