From dbf1340f8859f0cbdbf2b8cd404fdb5ccc282ac3 Mon Sep 17 00:00:00 2001 From: Boris Yumankulov Date: Thu, 12 Jun 2025 14:37:03 +0500 Subject: [PATCH] feat: added colors to AreWeAntiCheatYet badges Signed-off-by: Boris Yumankulov --- portprotonqt/game_card.py | 2 +- portprotonqt/main_window.py | 2 +- portprotonqt/themes/standart-light/styles.py | 20 +++++++++++++++++++ portprotonqt/themes/standart/styles.py | 21 ++++++++++++++++++++ 4 files changed, 43 insertions(+), 2 deletions(-) diff --git a/portprotonqt/game_card.py b/portprotonqt/game_card.py index 42b558a..8ad4a20 100644 --- a/portprotonqt/game_card.py +++ b/portprotonqt/game_card.py @@ -199,7 +199,7 @@ class GameCard(QFrame): icon_size=16, icon_space=3, ) - self.anticheatLabel.setStyleSheet(self.theme.STEAM_BADGE_STYLE) + self.anticheatLabel.setStyleSheet(self.theme.get_anticheat_badge_style(anticheat_status)) self.anticheatLabel.setFixedWidth(int(card_width * 2/3)) anticheat_visible = True else: diff --git a/portprotonqt/main_window.py b/portprotonqt/main_window.py index 46e0414..23af778 100644 --- a/portprotonqt/main_window.py +++ b/portprotonqt/main_window.py @@ -1492,7 +1492,7 @@ class MainWindow(QMainWindow): icon_size=16, icon_space=3, ) - anticheatLabel.setStyleSheet(self.theme.STEAM_BADGE_STYLE) + anticheatLabel.setStyleSheet(self.theme.get_anticheat_badge_style(anticheat_status)) anticheatLabel.setFixedWidth(badge_width) anticheatLabel.clicked.connect(lambda: QDesktopServices.openUrl(QUrl(f"https://areweanticheatyet.com/game/{name.lower().replace(' ', '-')}"))) anticheat_visible = True diff --git a/portprotonqt/themes/standart-light/styles.py b/portprotonqt/themes/standart-light/styles.py index 84d5da4..83f2435 100644 --- a/portprotonqt/themes/standart-light/styles.py +++ b/portprotonqt/themes/standart-light/styles.py @@ -416,6 +416,26 @@ def get_protondb_badge_style(tier): font-weight: bold; """ +def get_anticheat_badge_style(status): + status = status.lower() + status_colors = { + "supported": {"background": "rgba(102, 168, 15, 0.7)", "color": "black"}, + "running": {"background": "rgba(25, 113, 194, 0.7)", "color": "black"}, + "planned": {"background": "rgba(156, 54, 181, 0.7)", "color": "black"}, + "broken": {"background": "rgba(232, 89, 12, 0.7)", "color": "black"}, + "denied": {"background": "rgba(224, 49, 49, 0.7)", "color": "black"} + } + colors = status_colors.get(status, {"background": "rgba(0, 0, 0, 0.5)", "color": "white"}) + return f""" + qproperty-alignment: AlignCenter; + background-color: {colors["background"]}; + color: {colors["color"]}; + font-size: 14px; + border-radius: 5px; + font-family: 'Poppins'; + font-weight: bold; + """ + # СТИЛИ БЕЙДЖА STEAM STEAM_BADGE_STYLE= """ qproperty-alignment: AlignCenter; diff --git a/portprotonqt/themes/standart/styles.py b/portprotonqt/themes/standart/styles.py index 2ba0c9e..bcc6a27 100644 --- a/portprotonqt/themes/standart/styles.py +++ b/portprotonqt/themes/standart/styles.py @@ -478,6 +478,27 @@ def get_protondb_badge_style(tier): font-weight: bold; """ +# СТИЛИ БЕЙДЖА WEANTICHEATYET +def get_anticheat_badge_style(status): + status = status.lower() + status_colors = { + "supported": {"background": "rgba(102, 168, 15, 0.7)", "color": "black"}, + "running": {"background": "rgba(25, 113, 194, 0.7)", "color": "black"}, + "planned": {"background": "rgba(156, 54, 181, 0.7)", "color": "black"}, + "broken": {"background": "rgba(232, 89, 12, 0.7)", "color": "black"}, + "denied": {"background": "rgba(224, 49, 49, 0.7)", "color": "black"} + } + colors = status_colors.get(status, {"background": "rgba(0, 0, 0, 0.5)", "color": "white"}) + return f""" + qproperty-alignment: AlignCenter; + background-color: {colors["background"]}; + color: {colors["color"]}; + font-size: 16px; + border-radius: 5px; + font-family: 'Play'; + font-weight: bold; + """ + # СТИЛИ БЕЙДЖА STEAM STEAM_BADGE_STYLE= """ qproperty-alignment: AlignCenter;