fix: correct badge positioning in GameCard.update_badge_visibility

Signed-off-by: Boris Yumankulov <boria138@altlinux.org>
This commit is contained in:
2025-06-07 19:08:53 +05:00
parent 3e49357152
commit a5977f0f59

View File

@ -272,29 +272,21 @@ class GameCard(QFrame):
top_y = 10 top_y = 10
badge_y_positions = [] badge_y_positions = []
badge_width = int(self.coverLabel.width() * 2/3) badge_width = int(self.coverLabel.width() * 2/3)
if self.steam_visible:
steam_x = self.coverLabel.width() - badge_width - right_margin badges = [
self.steamLabel.move(steam_x, top_y) (self.steam_visible, self.steamLabel),
badge_y_positions.append(top_y + self.steamLabel.height()) (self.egs_visible, self.egsLabel),
if self.egs_visible: (self.portproton_visible, self.portprotonLabel),
egs_x = self.coverLabel.width() - badge_width - right_margin (self.protondbLabel.isVisible(), self.protondbLabel),
egs_y = badge_y_positions[-1] + badge_spacing if badge_y_positions else top_y (self.anticheatLabel.isVisible(), self.anticheatLabel),
self.egsLabel.move(egs_x, egs_y) ]
badge_y_positions.append(egs_y + self.egsLabel.height())
if self.portproton_visible: for is_visible, badge in badges:
portproton_x = self.coverLabel.width() - badge_width - right_margin if is_visible:
portproton_y = badge_y_positions[-1] + badge_spacing if badge_y_positions else top_y badge_x = self.coverLabel.width() - badge_width - right_margin
self.portprotonLabel.move(portproton_x, portproton_y) badge_y = badge_y_positions[-1] + badge_spacing if badge_y_positions else top_y
badge_y_positions.append(portproton_y + self.portprotonLabel.height()) badge.move(badge_x, badge_y)
if self.protondbLabel.isVisible(): badge_y_positions.append(badge_y + badge.height())
protondb_x = self.coverLabel.width() - badge_width - right_margin
protondb_y = badge_y_positions[-1] + badge_spacing if badge_y_positions else top_y
self.protondbLabel.move(protondb_x, protondb_y)
badge_y_positions.append(protondb_y + self.protondbLabel.height())
if self.anticheatLabel.isVisible():
anticheat_x = self.coverLabel.width() - badge_width - right_margin
anticheat_y = badge_y_positions[-1] + badge_spacing if badge_y_positions else top_y
self.anticheatLabel.move(anticheat_x, anticheat_y)
self.anticheatLabel.raise_() self.anticheatLabel.raise_()
self.protondbLabel.raise_() self.protondbLabel.raise_()