Fix installing game widget
This commit is contained in:
parent
0a7387c4fa
commit
718bfa0278
|
@ -34,7 +34,7 @@ class GameList(QStackedWidget):
|
|||
self.core = core
|
||||
self.setObjectName("list_widget")
|
||||
self.offline = offline
|
||||
self.installing_widget = InstallingGameWidget(self.core.get_game("CrabEA"))
|
||||
self.installing_widget = InstallingGameWidget()
|
||||
self.settings = QSettings()
|
||||
icon_view = self.settings.value("icon_view", True, bool)
|
||||
self.procs = []
|
||||
|
@ -83,7 +83,7 @@ class GameList(QStackedWidget):
|
|||
self.mac_games = []
|
||||
self.installed = sorted(self.core.get_installed_list(), key=lambda x: x.title)
|
||||
|
||||
self.installing_widget = InstallingGameWidget(self.core.get_game("CrabEA"))
|
||||
self.installing_widget = InstallingGameWidget()
|
||||
self.icon_layout.addWidget(self.installing_widget)
|
||||
self.installing_widget.setVisible(False)
|
||||
|
||||
|
|
|
@ -7,26 +7,25 @@ from rare.utils.utils import get_pixmap, get_uninstalled_pixmap, optimal_text_ba
|
|||
|
||||
|
||||
class InstallingGameWidget(QGroupBox):
|
||||
def __init__(self, game: Game):
|
||||
def __init__(self):
|
||||
super(InstallingGameWidget, self).__init__()
|
||||
self.setObjectName("game_widget_icon")
|
||||
|
||||
self.setLayout(QVBoxLayout())
|
||||
|
||||
self.pixmap = get_pixmap(game.app_name)
|
||||
self.pixmap = QPixmap()
|
||||
w = 200
|
||||
self.pixmap = self.pixmap.scaled(w, int(w * 4 / 3), transformMode=Qt.SmoothTransformation)
|
||||
|
||||
self.image_widget = PaintWidget(self.pixmap, game.app_name)
|
||||
# self.pixmap = self.pixmap.scaled(w, int(w * 4 / 3), transformMode=Qt.SmoothTransformation)
|
||||
self.image_widget = PaintWidget()
|
||||
self.image_widget.setFixedSize(w, int(w * 4 / 3))
|
||||
self.layout().addWidget(self.image_widget)
|
||||
|
||||
self.title_label = QLabel(f"<h4>{game.app_title}</h4>")
|
||||
self.title_label = QLabel(f"<h4>Error</h4>")
|
||||
self.title_label.setAutoFillBackground(False)
|
||||
self.title_label.setWordWrap(True)
|
||||
self.title_label.setFixedWidth(175)
|
||||
minilayout = QHBoxLayout()
|
||||
self.title_label.setObjectName("game_widget")
|
||||
self.setObjectName("game_widget")
|
||||
minilayout.addWidget(self.title_label)
|
||||
self.layout().addLayout(minilayout)
|
||||
|
||||
|
@ -39,9 +38,8 @@ class InstallingGameWidget(QGroupBox):
|
|||
|
||||
|
||||
class PaintWidget(QWidget):
|
||||
def __init__(self, image: QPixmap, app_name):
|
||||
def __init__(self):
|
||||
super(PaintWidget, self).__init__()
|
||||
self.set_game(image, app_name)
|
||||
|
||||
def set_game(self, pixmap: QPixmap, app_name):
|
||||
self.image = pixmap
|
||||
|
|
Loading…
Reference in a new issue