2 Commits

Author SHA1 Message Date
83455bc33f fix: restore correct badge positioning on visibility change in GameCard
All checks were successful
Code and build check / Check code (push) Successful in 1m20s
Code and build check / Build with uv (push) Successful in 46s
Signed-off-by: Boris Yumankulov <boria138@altlinux.org>
2025-06-07 21:40:27 +05:00
2377426b27 fix: correct badge positioning in GameCard on display filter change (again)
Signed-off-by: Boris Yumankulov <boria138@altlinux.org>
2025-06-07 21:31:07 +05:00

View File

@@ -261,26 +261,32 @@ class GameCard(QFrame):
self.steam_visible = (str(self.game_source).lower() == "steam" and display_filter in ("all", "favorites"))
self.egs_visible = (str(self.game_source).lower() == "epic" and display_filter in ("all", "favorites"))
self.portproton_visible = (str(self.game_source).lower() == "portproton" and display_filter in ("all", "favorites"))
protondb_visible = bool(self.getProtonDBText(self.protondb_tier))
anticheat_visible = bool(self.getAntiCheatText(self.anticheat_status))
# Обновляем видимость бейджей
self.steamLabel.setVisible(self.steam_visible)
self.egsLabel.setVisible(self.egs_visible)
self.portprotonLabel.setVisible(self.portproton_visible)
self.protondbLabel.setVisible(protondb_visible)
self.anticheatLabel.setVisible(anticheat_visible)
# Reposition badges
# Подготавливаем список всех бейджей с их текущей видимостью
badges = [
(self.steam_visible, self.steamLabel),
(self.egs_visible, self.egsLabel),
(self.portproton_visible, self.portprotonLabel),
(protondb_visible, self.protondbLabel),
(anticheat_visible, self.anticheatLabel),
]
# Пересчитываем позиции бейджей
right_margin = 8
badge_spacing = 5
top_y = 10
badge_y_positions = []
badge_width = int(self.coverLabel.width() * 2/3)
badges = [
(self.steam_visible, self.steamLabel),
(self.egs_visible, self.egsLabel),
(self.portproton_visible, self.portprotonLabel),
(self.protondbLabel.isVisible(), self.protondbLabel),
(self.anticheatLabel.isVisible(), self.anticheatLabel),
]
for is_visible, badge in badges:
if is_visible:
badge_x = self.coverLabel.width() - badge_width - right_margin
@@ -288,6 +294,7 @@ class GameCard(QFrame):
badge.move(badge_x, badge_y)
badge_y_positions.append(badge_y + badge.height())
# Поднимаем бейджи в правильном порядке (от нижнего к верхнему)
self.anticheatLabel.raise_()
self.protondbLabel.raise_()
self.portprotonLabel.raise_()