1
0
Fork 0
mirror of synced 2024-07-08 16:06:33 +12:00
Rare/rare/components/tabs/games/game_widgets/uninstalled_list_widget.py
loathingKernel 08ab130c5c LibraryLayout from #196
Introduces the LibraryLayout from #196.
This layout distributes the available space in either horizontal side and in-between the widgets.

Known issues: When searching for a game, it will re-align visible widgets, effectively centering the results.
This is because the search and grouping functions are interleaved. #196 handles it differently by adjusting
the opacity and re-ordering of the irrelevant widgets.

Signed-off-by: loathingKernel <142770+loathingKernel@users.noreply.github.com>
2022-06-20 19:04:46 +03:00

37 lines
1.3 KiB
Python

from logging import getLogger
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QLabel, QHBoxLayout, QVBoxLayout, QPushButton
from legendary.core import LegendaryCore
from rare.components.tabs.games.game_widgets.base_uninstalled_widget import (
BaseUninstalledWidget,
)
logger = getLogger("Game")
class ListWidgetUninstalled(BaseUninstalledWidget):
def __init__(self, core: LegendaryCore, game, pixmap):
super(ListWidgetUninstalled, self).__init__(game, core, pixmap)
self.setFrameStyle(self.StyledPanel)
layout = QHBoxLayout()
self.setLayout(layout)
layout.addWidget(self.image)
self.child_layout = QVBoxLayout()
layout.addLayout(self.child_layout)
self.title_label = QLabel(f"<h2>{self.game.app_title}</h2>")
self.app_name_label = QLabel(f"App Name: {self.game.app_name}")
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.install_button)
layout.setAlignment(Qt.AlignLeft)
self.child_layout.setAlignment(Qt.AlignTop)