forked from Boria138/PortProtonQt
feat: added colors to AreWeAntiCheatYet badges
Signed-off-by: Boris Yumankulov <boria138@altlinux.org>
This commit is contained in:
@ -199,7 +199,7 @@ class GameCard(QFrame):
|
|||||||
icon_size=16,
|
icon_size=16,
|
||||||
icon_space=3,
|
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))
|
self.anticheatLabel.setFixedWidth(int(card_width * 2/3))
|
||||||
anticheat_visible = True
|
anticheat_visible = True
|
||||||
else:
|
else:
|
||||||
|
@ -1492,7 +1492,7 @@ class MainWindow(QMainWindow):
|
|||||||
icon_size=16,
|
icon_size=16,
|
||||||
icon_space=3,
|
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.setFixedWidth(badge_width)
|
||||||
anticheatLabel.clicked.connect(lambda: QDesktopServices.openUrl(QUrl(f"https://areweanticheatyet.com/game/{name.lower().replace(' ', '-')}")))
|
anticheatLabel.clicked.connect(lambda: QDesktopServices.openUrl(QUrl(f"https://areweanticheatyet.com/game/{name.lower().replace(' ', '-')}")))
|
||||||
anticheat_visible = True
|
anticheat_visible = True
|
||||||
|
@ -416,6 +416,26 @@ def get_protondb_badge_style(tier):
|
|||||||
font-weight: bold;
|
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
|
||||||
STEAM_BADGE_STYLE= """
|
STEAM_BADGE_STYLE= """
|
||||||
qproperty-alignment: AlignCenter;
|
qproperty-alignment: AlignCenter;
|
||||||
|
@ -478,6 +478,27 @@ def get_protondb_badge_style(tier):
|
|||||||
font-weight: bold;
|
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
|
||||||
STEAM_BADGE_STYLE= """
|
STEAM_BADGE_STYLE= """
|
||||||
qproperty-alignment: AlignCenter;
|
qproperty-alignment: AlignCenter;
|
||||||
|
Reference in New Issue
Block a user