From eb90836710067059868eb46425d8880358831c6b Mon Sep 17 00:00:00 2001 From: Boris Yumankulov Date: Sat, 30 Aug 2025 10:59:18 +0500 Subject: [PATCH] chore: change cover aspect ratio Signed-off-by: Boris Yumankulov --- portprotonqt/game_card.py | 12 ++++++------ portprotonqt/main_window.py | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/portprotonqt/game_card.py b/portprotonqt/game_card.py index 4e433c2..9dce43a 100644 --- a/portprotonqt/game_card.py +++ b/portprotonqt/game_card.py @@ -99,7 +99,7 @@ class GameCard(QFrame): self.coverLabel.setStyleSheet(self.theme.COVER_LABEL_STYLE) coverLayout.addWidget(self.coverLabel) - load_pixmap_async(cover_path or "", self.base_card_width, int(self.base_card_width * 1.2), self.on_cover_loaded) + load_pixmap_async(cover_path or "", self.base_card_width, int(self.base_card_width * 1.5), self.on_cover_loaded) self.favoriteLabel = ClickableLabel(self.coverWidget) self.favoriteLabel.clicked.connect(self.toggle_favorite) @@ -206,7 +206,7 @@ class GameCard(QFrame): def update_cover_pixmap(self): if self.base_pixmap: scaled_width = int(self.base_card_width * self._scale) - scaled_pixmap = self.base_pixmap.scaled(scaled_width, int(scaled_width * 1.2), Qt.AspectRatioMode.KeepAspectRatioByExpanding, Qt.TransformationMode.SmoothTransformation) + scaled_pixmap = self.base_pixmap.scaled(scaled_width, int(scaled_width * 1.5), Qt.AspectRatioMode.KeepAspectRatioByExpanding, Qt.TransformationMode.SmoothTransformation) rounded_pixmap = round_corners(scaled_pixmap, int(15 * self._scale)) self.coverLabel.setPixmap(rounded_pixmap) @@ -240,13 +240,13 @@ class GameCard(QFrame): def update_scale(self): scaled_width = int(self.base_card_width * self._scale) - scaled_height = int(self.base_card_width * 1.6 * self._scale) + scaled_height = int(self.base_card_width * 1.8 * self._scale) scaled_extra = int(self.base_extra_margin * self._scale) self.setFixedSize(scaled_width + scaled_extra, scaled_height + scaled_extra) self.layout_.setContentsMargins(scaled_extra // 2, scaled_extra // 2, scaled_extra // 2, scaled_extra // 2) - self.coverWidget.setFixedSize(scaled_width, int(scaled_width * 1.2)) - self.coverLabel.setFixedSize(scaled_width, int(scaled_width * 1.2)) + self.coverWidget.setFixedSize(scaled_width, int(scaled_width * 1.5)) + self.coverLabel.setFixedSize(scaled_width, int(scaled_width * 1.5)) self.update_cover_pixmap() @@ -289,7 +289,7 @@ class GameCard(QFrame): def update_card_size(self, new_width: int): self.base_card_width = new_width - load_pixmap_async(self.cover_path or "", new_width, int(new_width * 1.2), self.on_cover_loaded) + load_pixmap_async(self.cover_path or "", new_width, int(new_width * 1.5), self.on_cover_loaded) self.update_scale() def update_badge_visibility(self, display_filter: str): diff --git a/portprotonqt/main_window.py b/portprotonqt/main_window.py index c656931..be73789 100644 --- a/portprotonqt/main_window.py +++ b/portprotonqt/main_window.py @@ -1528,7 +1528,7 @@ class MainWindow(QMainWindow): detailPage = QWidget() self._animations = {} imageLabel = QLabel() - imageLabel.setFixedSize(300, 400) + imageLabel.setFixedSize(300, 450) self._detail_page_active = True self._current_detail_page = detailPage @@ -1562,7 +1562,7 @@ class MainWindow(QMainWindow): logger.debug("Stylesheet updated with palette") self.getColorPalette_async(cover_path, num_colors=5, callback=on_palette_ready) - load_pixmap_async(cover_path, 300, 400, on_pixmap_ready) + load_pixmap_async(cover_path, 300, 450, on_pixmap_ready) else: detailPage.setStyleSheet(self.theme.DETAIL_PAGE_NO_COVER_STYLE) detailPage.update() @@ -1590,7 +1590,7 @@ class MainWindow(QMainWindow): # Обложка (слева) coverFrame = QFrame() - coverFrame.setFixedSize(300, 400) + coverFrame.setFixedSize(300, 450) coverFrame.setStyleSheet(self.theme.COVER_FRAME_STYLE) shadow = QGraphicsDropShadowEffect(coverFrame) shadow.setBlurRadius(20)