2021-03-25 23:49:05 +13:00
|
|
|
from logging import getLogger
|
|
|
|
|
|
|
|
from PyQt5.QtWidgets import QLabel, QHBoxLayout, QVBoxLayout, QPushButton
|
|
|
|
|
2021-04-08 08:42:30 +12:00
|
|
|
from rare.components.tabs.games.game_widgets.base_uninstalled_widget import BaseUninstalledWidget
|
2021-03-25 23:49:05 +13:00
|
|
|
from custom_legendary.core import LegendaryCore
|
|
|
|
|
|
|
|
logger = getLogger("Game")
|
|
|
|
|
|
|
|
|
|
|
|
class ListWidgetUninstalled(BaseUninstalledWidget):
|
|
|
|
|
|
|
|
def __init__(self, core: LegendaryCore, game, pixmap):
|
|
|
|
super(ListWidgetUninstalled, self).__init__(game, core, pixmap)
|
|
|
|
self.layout = QHBoxLayout()
|
|
|
|
|
2021-03-26 00:14:34 +13:00
|
|
|
if self.pixmap:
|
|
|
|
w = 200
|
|
|
|
self.pixmap = self.pixmap.scaled(w, int(w * 4 / 3))
|
|
|
|
self.image = QLabel()
|
|
|
|
self.image.setPixmap(self.pixmap)
|
|
|
|
self.layout.addWidget(self.image)
|
|
|
|
|
2021-03-25 23:49:05 +13:00
|
|
|
self.child_layout = QVBoxLayout()
|
|
|
|
|
|
|
|
self.title_label = QLabel(f"<h2>{self.game.app_title}</h2>")
|
|
|
|
self.app_name_label = QLabel(f"App Name: {self.game.app_name}")
|
|
|
|
self.version_label = QLabel(f"Version: {self.game.app_version}")
|
|
|
|
self.install_button = QPushButton(self.tr("Install"))
|
|
|
|
self.install_button.setFixedWidth(120)
|
|
|
|
self.install_button.clicked.connect(self.install)
|
|
|
|
|
|
|
|
self.child_layout.addWidget(self.title_label)
|
|
|
|
self.child_layout.addWidget(self.app_name_label)
|
|
|
|
self.child_layout.addWidget(self.version_label)
|
|
|
|
self.child_layout.addWidget(self.install_button)
|
|
|
|
self.child_layout.addStretch(1)
|
|
|
|
self.layout.addLayout(self.child_layout)
|
|
|
|
|
|
|
|
self.layout.addStretch(1)
|
|
|
|
self.setLayout(self.layout)
|