Compare commits
2 Commits
a5977f0f59
...
83455bc33f
Author | SHA1 | Date | |
---|---|---|---|
83455bc33f
|
|||
2377426b27
|
@@ -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_()
|
||||
|
Reference in New Issue
Block a user