From 4b95609fd683ce999dda65a7f3dc6b35394ea570 Mon Sep 17 00:00:00 2001 From: loathingKernel <142770+loathingKernel@users.noreply.github.com> Date: Tue, 14 Jan 2025 01:39:45 +0200 Subject: [PATCH 1/2] EosGroup: simplify layout by moving the form out of the stack --- .../tabs/library/details/details.py | 1 + .../tabs/library/integrations/eos_group.py | 80 +++--- .../tabs/library/integrations/eos_widget.py | 119 ++++---- .../tabs/library/integrations/eos_widget.ui | 271 ++++++++---------- 4 files changed, 216 insertions(+), 255 deletions(-) diff --git a/rare/components/tabs/library/details/details.py b/rare/components/tabs/library/details/details.py index 5e3cd6cba..f5182b00f 100644 --- a/rare/components/tabs/library/details/details.py +++ b/rare/components/tabs/library/details/details.py @@ -38,6 +38,7 @@ def __init__(self, parent=None): self.ui = Ui_GameDetails() self.ui.setupUi(self) # lk: set object names for CSS properties + self.ui.install_path.setObjectName("LinkLabel") self.ui.install_button.setObjectName("InstallButton") self.ui.modify_button.setObjectName("InstallButton") self.ui.uninstall_button.setObjectName("UninstallButton") diff --git a/rare/components/tabs/library/integrations/eos_group.py b/rare/components/tabs/library/integrations/eos_group.py index 3d51d8988..10daf8c1b 100644 --- a/rare/components/tabs/library/integrations/eos_group.py +++ b/rare/components/tabs/library/integrations/eos_group.py @@ -56,8 +56,11 @@ def __init__(self, overlay: RareEosOverlay, prefix: Optional[str], parent=None): prefix.replace(os.path.expanduser("~"), "~") if prefix is not None else overlay.app_title, parent=self, ) + self.prefix_label.setAlignment(Qt.AlignmentFlag.AlignLeft|Qt.AlignmentFlag.AlignVCenter) + self.overlay_label = ElideLabel(parent=self) self.overlay_label.setDisabled(True) + self.overlay_label.setAlignment(Qt.AlignmentFlag.AlignRight|Qt.AlignmentFlag.AlignVCenter) self.path_select = QComboBox(self) self.path_select.setMaximumWidth(150) @@ -68,11 +71,11 @@ def __init__(self, overlay: RareEosOverlay, prefix: Optional[str], parent=None): layout = QHBoxLayout(self) layout.setContentsMargins(-1, 0, 0, 0) - layout.addWidget(self.indicator) + layout.addWidget(self.indicator, alignment=Qt.AlignmentFlag.AlignLeft) layout.addWidget(self.prefix_label, stretch=2) - layout.addWidget(self.overlay_label, stretch=3) - layout.addWidget(self.path_select) - layout.addWidget(self.button) + layout.addWidget(self.overlay_label, stretch=1) + layout.addWidget(self.path_select, alignment=Qt.AlignmentFlag.AlignRight) + layout.addWidget(self.button, alignment=Qt.AlignmentFlag.AlignRight) self.overlay = overlay self.prefix = prefix @@ -98,12 +101,15 @@ def update_state(self) -> None: active_path = os.path.normpath(p) if (p := self.overlay.active_path(self.prefix)) else "" self.overlay_label.setText(f"{active_path}") + self.overlay_label.setVisible(bool(active_path)) self.path_select.clear() if not self.overlay.is_installed and not self.overlay.available_paths(self.prefix): self.setDisabled(True) self.indicator.setPixmap(qta_icon("fa.circle-o", color="grey").pixmap(20, 20)) - self.overlay_label.setText(self.overlay.active_path(self.prefix)) + active_path = self.overlay.active_path(self.prefix) + self.overlay_label.setText(f"{active_path}") + self.overlay_label.setVisible(bool(active_path)) self.button.setText(self.tr("Unavailable")) return @@ -168,18 +174,19 @@ def __init__(self, parent=None): self.ui.install_button.setObjectName("InstallButton") self.ui.uninstall_button.setObjectName("UninstallButton") - self.ui.install_page_layout.setAlignment(Qt.AlignmentFlag.AlignTop) - self.ui.info_page_layout.setAlignment(Qt.AlignmentFlag.AlignTop) + self.ui.install_page_layout.setAlignment(Qt.AlignmentFlag.AlignBottom) + self.ui.update_page_layout.setAlignment(Qt.AlignmentFlag.AlignBottom) self.ui.install_button.setIcon(qta_icon("ri.install-line")) self.ui.uninstall_button.setIcon(qta_icon("ri.uninstall-line")) - self.installed_path_label = ElideLabel(parent=self) - self.installed_path_label.setOpenExternalLinks(True) - self.installed_version_label = ElideLabel(parent=self) + self.version = ElideLabel(parent=self) + self.install_path = QLabel(parent=self) + self.install_path.setObjectName("LinkLabel") + self.install_path.setOpenExternalLinks(True) - self.ui.info_label_layout.setWidget(0, QFormLayout.ItemRole.FieldRole, self.installed_version_label) - self.ui.info_label_layout.setWidget(1, QFormLayout.ItemRole.FieldRole, self.installed_path_label) + self.ui.info_layout.setWidget(0, QFormLayout.ItemRole.FieldRole, self.version) + self.ui.info_layout.setWidget(1, QFormLayout.ItemRole.FieldRole, self.install_path) self.rcore = RareCore.instance() self.core = self.rcore.core() @@ -194,31 +201,31 @@ def __init__(self, parent=None): self.ui.update_button.clicked.connect(self.install_overlay) self.ui.uninstall_button.clicked.connect(self.uninstall_overlay) - if self.overlay.is_installed: # installed - self.installed_version_label.setText(f"{self.overlay.version}") - self.installed_path_label.setText( - style_hyperlink( - QUrl.fromLocalFile(self.overlay.install_path).toString(), self.overlay.install_path - ) - ) - self.ui.overlay_stack.setCurrentWidget(self.ui.info_page) - else: - self.ui.overlay_stack.setCurrentWidget(self.ui.install_page) - self.ui.update_button.setEnabled(False) - self.threadpool = QThreadPool.globalInstance() self.worker: Optional[CheckForUpdateWorker] = None def showEvent(self, a0: QShowEvent) -> None: if a0.spontaneous(): return super().showEvent(a0) - self.check_for_update() - self.update_prefixes() self.update_state() + self.update_prefixes() + self.check_for_update() super().showEvent(a0) @Slot() def update_state(self): + if self.overlay.is_installed: # installed + self.version.setText(f"{self.overlay.version}") + self.ui.button_stack.setCurrentWidget(self.ui.update_page) + else: + self.version.setText(self.tr("Epic Online Services Overlay is not installed")) + self.ui.button_stack.setCurrentWidget(self.ui.install_page) + self.install_path.setEnabled(self.overlay.is_installed) + self.install_path.setText( + style_hyperlink(QUrl.fromLocalFile(self.overlay.install_path).toString(), self.overlay.install_path) + if self.overlay.is_installed else "N/A" + ) + self.ui.install_button.setEnabled(self.overlay.state == RareEosOverlay.State.IDLE) self.ui.update_button.setEnabled(self.overlay.state == RareEosOverlay.State.IDLE and self.overlay.has_update) self.ui.uninstall_button.setEnabled(self.overlay.state == RareEosOverlay.State.IDLE) @@ -244,7 +251,7 @@ def update_prefixes(self): @Slot(bool) def check_for_update_finished(self, update_available: bool): self.worker = None - self.ui.update_button.setEnabled(update_available) + self.ui.update_button.setEnabled(self.overlay.state == RareEosOverlay.State.IDLE and update_available) def check_for_update(self): self.ui.update_button.setEnabled(False) @@ -261,21 +268,14 @@ def check_for_update(self): @Slot() def install_finished(self): if not self.overlay.is_installed: - logger.error("Something went wrong while installing overlay") - QMessageBox.warning(self, "Error", self.tr("Something went wrong while installing Overlay")) + logger.error("Something went wrong while installing EOS Overlay") + QMessageBox.warning(self, "Error", self.tr("Something went wrong while installing EOS Overlay")) return - self.ui.overlay_stack.setCurrentWidget(self.ui.info_page) - self.installed_version_label.setText(f"{self.overlay.version}") - self.installed_path_label.setText( - style_hyperlink( - QUrl.fromLocalFile(self.overlay.install_path).toString(), self.overlay.install_path - ) - ) - self.ui.update_button.setEnabled(False) + self.update_state() @Slot() def uninstall_finished(self): - self.ui.overlay_stack.setCurrentWidget(self.ui.install_page) + self.update_state() @Slot() def install_overlay(self): @@ -283,7 +283,7 @@ def install_overlay(self): def uninstall_overlay(self): if not self.overlay.is_installed: - logger.error("No Legendary-managed overlay installation found.") - self.ui.overlay_stack.setCurrentWidget(self.ui.install_page) + logger.error("No Legendary-managed EOS Overlay installation found.") + self.ui.button_stack.setCurrentWidget(self.ui.install_page) return self.overlay.uninstall() diff --git a/rare/ui/components/tabs/library/integrations/eos_widget.py b/rare/ui/components/tabs/library/integrations/eos_widget.py index a7a9f7f55..32ee1945d 100644 --- a/rare/ui/components/tabs/library/integrations/eos_widget.py +++ b/rare/ui/components/tabs/library/integrations/eos_widget.py @@ -3,7 +3,7 @@ ################################################################################ ## Form generated from reading UI file 'eos_widget.ui' ## -## Created by: Qt User Interface Compiler version 6.7.2 +## Created by: Qt User Interface Compiler version 6.8.1 ## ## WARNING! All changes made in this file will be lost when recompiling UI file! ################################################################################ @@ -23,109 +23,86 @@ class Ui_EosWidget(object): def setupUi(self, EosWidget): if not EosWidget.objectName(): EosWidget.setObjectName(u"EosWidget") - EosWidget.resize(465, 98) + EosWidget.resize(528, 95) EosWidget.setWindowTitle(u"GroupBox") self.eos_layout = QVBoxLayout(EosWidget) self.eos_layout.setObjectName(u"eos_layout") - self.eos_layout.setSizeConstraint(QLayout.SetDefaultConstraint) - self.overlay_stack = QStackedWidget(EosWidget) - self.overlay_stack.setObjectName(u"overlay_stack") - self.install_page = QWidget() - self.install_page.setObjectName(u"install_page") - self.install_page_layout = QHBoxLayout(self.install_page) - self.install_page_layout.setObjectName(u"install_page_layout") - self.install_page_layout.setContentsMargins(0, 0, 0, 0) - self.install_label_layout = QFormLayout() - self.install_label_layout.setObjectName(u"install_label_layout") - self.install_label_layout.setLabelAlignment(Qt.AlignmentFlag.AlignRight|Qt.AlignmentFlag.AlignTop|Qt.AlignTrailing) - self.install_label_layout.setFormAlignment(Qt.AlignmentFlag.AlignLeading|Qt.AlignmentFlag.AlignLeft|Qt.AlignmentFlag.AlignTop) - self.install_label = QLabel(self.install_page) - self.install_label.setObjectName(u"install_label") + self.eos_layout.setSizeConstraint(QLayout.SizeConstraint.SetDefaultConstraint) + self.overlay_widget = QWidget(EosWidget) + self.overlay_widget.setObjectName(u"overlay_widget") + self.overlay_widget_layout = QHBoxLayout(self.overlay_widget) + self.overlay_widget_layout.setObjectName(u"overlay_widget_layout") + self.overlay_widget_layout.setContentsMargins(0, 0, 0, 0) + self.info_layout = QFormLayout() + self.info_layout.setObjectName(u"info_layout") + self.info_layout.setLabelAlignment(Qt.AlignmentFlag.AlignRight|Qt.AlignmentFlag.AlignTop|Qt.AlignmentFlag.AlignTrailing) + self.info_layout.setFormAlignment(Qt.AlignmentFlag.AlignLeading|Qt.AlignmentFlag.AlignLeft|Qt.AlignmentFlag.AlignTop) + self.version_label = QLabel(self.overlay_widget) + self.version_label.setObjectName(u"version_label") + self.version_label.setAlignment(Qt.AlignmentFlag.AlignRight|Qt.AlignmentFlag.AlignTrailing|Qt.AlignmentFlag.AlignVCenter) - self.install_label_layout.setWidget(0, QFormLayout.LabelRole, self.install_label) + self.info_layout.setWidget(0, QFormLayout.LabelRole, self.version_label) - self.install_text = QLabel(self.install_page) - self.install_text.setObjectName(u"install_text") + self.path_label = QLabel(self.overlay_widget) + self.path_label.setObjectName(u"path_label") + self.path_label.setAlignment(Qt.AlignmentFlag.AlignRight|Qt.AlignmentFlag.AlignTrailing|Qt.AlignmentFlag.AlignVCenter) - self.install_label_layout.setWidget(0, QFormLayout.ItemRole.FieldRole, self.install_text) + self.info_layout.setWidget(1, QFormLayout.LabelRole, self.path_label) - self.install_page_layout.addLayout(self.install_label_layout) + self.overlay_widget_layout.addLayout(self.info_layout) - self.install_button_layout = QVBoxLayout() - self.install_button_layout.setObjectName(u"install_button_layout") - self.install_button_layout.setContentsMargins(-1, -1, 0, -1) + self.button_stack = QStackedWidget(self.overlay_widget) + self.button_stack.setObjectName(u"button_stack") + self.install_page = QWidget() + self.install_page.setObjectName(u"install_page") + self.install_page_layout = QHBoxLayout(self.install_page) + self.install_page_layout.setObjectName(u"install_page_layout") + self.install_page_layout.setContentsMargins(0, 0, 0, 0) self.install_button = QPushButton(self.install_page) self.install_button.setObjectName(u"install_button") - self.install_button.setMinimumSize(QSize(140, 0)) + self.install_button.setMinimumSize(QSize(140, 26)) - self.install_button_layout.addWidget(self.install_button, 0, Qt.AlignmentFlag.AlignTop) + self.install_page_layout.addWidget(self.install_button, 0, Qt.AlignmentFlag.AlignBottom) - - self.install_page_layout.addLayout(self.install_button_layout) - - self.install_page_layout.setStretch(0, 1) - self.overlay_stack.addWidget(self.install_page) - self.info_page = QWidget() - self.info_page.setObjectName(u"info_page") - self.info_page_layout = QHBoxLayout(self.info_page) - self.info_page_layout.setObjectName(u"info_page_layout") - self.info_page_layout.setContentsMargins(0, 0, 0, 0) - self.info_label_layout = QFormLayout() - self.info_label_layout.setObjectName(u"info_label_layout") - self.info_label_layout.setLabelAlignment(Qt.AlignmentFlag.AlignRight|Qt.AlignmentFlag.AlignTop|Qt.AlignTrailing) - self.info_label_layout.setFormAlignment(Qt.AlignmentFlag.AlignLeading|Qt.AlignmentFlag.AlignLeft|Qt.AlignmentFlag.AlignTop) - self.version_label = QLabel(self.info_page) - self.version_label.setObjectName(u"version_label") - self.version_label.setAlignment(Qt.AlignmentFlag.AlignRight|Qt.AlignTrailing|Qt.AlignmentFlag.AlignVCenter) - - self.info_label_layout.setWidget(0, QFormLayout.LabelRole, self.version_label) - - self.path_label = QLabel(self.info_page) - self.path_label.setObjectName(u"path_label") - self.path_label.setAlignment(Qt.AlignmentFlag.AlignRight|Qt.AlignTrailing|Qt.AlignmentFlag.AlignVCenter) - - self.info_label_layout.setWidget(1, QFormLayout.LabelRole, self.path_label) - - - self.info_page_layout.addLayout(self.info_label_layout) - - self.info_button_layout = QVBoxLayout() - self.info_button_layout.setObjectName(u"info_button_layout") - self.update_button = QPushButton(self.info_page) + self.button_stack.addWidget(self.install_page) + self.update_page = QWidget() + self.update_page.setObjectName(u"update_page") + self.update_page_layout = QVBoxLayout(self.update_page) + self.update_page_layout.setObjectName(u"update_page_layout") + self.update_page_layout.setContentsMargins(0, 0, 0, 0) + self.update_button = QPushButton(self.update_page) self.update_button.setObjectName(u"update_button") - self.update_button.setMinimumSize(QSize(140, 0)) + self.update_button.setMinimumSize(QSize(140, 26)) - self.info_button_layout.addWidget(self.update_button, 0, Qt.AlignmentFlag.AlignTop) + self.update_page_layout.addWidget(self.update_button, 0, Qt.AlignmentFlag.AlignBottom) - self.uninstall_button = QPushButton(self.info_page) + self.uninstall_button = QPushButton(self.update_page) self.uninstall_button.setObjectName(u"uninstall_button") - self.uninstall_button.setMinimumSize(QSize(140, 0)) + self.uninstall_button.setMinimumSize(QSize(140, 26)) - self.info_button_layout.addWidget(self.uninstall_button, 0, Qt.AlignmentFlag.AlignTop) + self.update_page_layout.addWidget(self.uninstall_button, 0, Qt.AlignmentFlag.AlignBottom) + self.button_stack.addWidget(self.update_page) - self.info_page_layout.addLayout(self.info_button_layout) + self.overlay_widget_layout.addWidget(self.button_stack, 0, Qt.AlignmentFlag.AlignTop) - self.info_page_layout.setStretch(0, 1) - self.overlay_stack.addWidget(self.info_page) + self.overlay_widget_layout.setStretch(0, 1) - self.eos_layout.addWidget(self.overlay_stack) + self.eos_layout.addWidget(self.overlay_widget, 0, Qt.AlignmentFlag.AlignTop) self.retranslateUi(EosWidget) - self.overlay_stack.setCurrentIndex(0) + self.button_stack.setCurrentIndex(1) # setupUi def retranslateUi(self, EosWidget): EosWidget.setTitle(QCoreApplication.translate("EosWidget", u"Epic Overlay", None)) - self.install_label.setText(QCoreApplication.translate("EosWidget", u"Version", None)) - self.install_text.setText(QCoreApplication.translate("EosWidget", u"Epic Online Services Overlay is not installed", None)) - self.install_button.setText(QCoreApplication.translate("EosWidget", u"Install", None)) self.version_label.setText(QCoreApplication.translate("EosWidget", u"Version", None)) self.path_label.setText(QCoreApplication.translate("EosWidget", u"Install folder", None)) + self.install_button.setText(QCoreApplication.translate("EosWidget", u"Install", None)) self.update_button.setText(QCoreApplication.translate("EosWidget", u"Update", None)) self.uninstall_button.setText(QCoreApplication.translate("EosWidget", u"Uninstall", None)) # retranslateUi diff --git a/rare/ui/components/tabs/library/integrations/eos_widget.ui b/rare/ui/components/tabs/library/integrations/eos_widget.ui index 4dec2a314..75158feaa 100644 --- a/rare/ui/components/tabs/library/integrations/eos_widget.ui +++ b/rare/ui/components/tabs/library/integrations/eos_widget.ui @@ -6,8 +6,8 @@ 0 0 - 465 - 98 + 528 + 95 @@ -18,149 +18,132 @@ - QLayout::SetDefaultConstraint + QLayout::SizeConstraint::SetDefaultConstraint - - - - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - - Version - - - - - - - Epic Online Services Overlay is not installed - - - - - - - - - 0 - - - - - - 140 - 0 - - - - Install - - - - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - - Version - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - Install folder - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - - - 140 - 0 - - - - Update - - - - - - - - 140 - 0 - - - - Uninstall - - - - - - - + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTop|Qt::AlignmentFlag::AlignTrailing + + + Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop + + + + + Version + + + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter + + + + + + + Install folder + + + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter + + + + + + + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 140 + 26 + + + + Install + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 140 + 26 + + + + Update + + + + + + + + 140 + 26 + + + + Uninstall + + + + + + + + From 4b54e583d9e16eb4fbcf695d6b3ba4d961b305c7 Mon Sep 17 00:00:00 2001 From: loathingKernel <142770+loathingKernel@users.noreply.github.com> Date: Tue, 14 Jan 2025 15:44:18 +0200 Subject: [PATCH 2/2] GameSettings: group wine and proton groups under compatibility --- .../tabs/settings/widgets/env_vars.py | 2 +- rare/components/tabs/settings/widgets/game.py | 45 ++++++++++++++----- .../tabs/settings/widgets/launch.py | 2 +- .../tabs/settings/widgets/overlay.py | 4 +- .../tabs/settings/widgets/proton.py | 2 +- rare/components/tabs/settings/widgets/wine.py | 5 ++- rare/ui/components/tabs/settings/legendary.py | 12 ++--- rare/ui/components/tabs/settings/legendary.ui | 16 +++---- 8 files changed, 57 insertions(+), 31 deletions(-) diff --git a/rare/components/tabs/settings/widgets/env_vars.py b/rare/components/tabs/settings/widgets/env_vars.py index 2f52035bb..71e4c7453 100644 --- a/rare/components/tabs/settings/widgets/env_vars.py +++ b/rare/components/tabs/settings/widgets/env_vars.py @@ -18,7 +18,7 @@ class EnvVars(QGroupBox): def __init__(self, parent): super(EnvVars, self).__init__(parent=parent) - self.setTitle(self.tr("Environment variables")) + self.setTitle(self.tr("Environment")) self.core = LegendaryCoreSingleton() self.app_name: str = "default" diff --git a/rare/components/tabs/settings/widgets/game.py b/rare/components/tabs/settings/widgets/game.py index ede442c19..f3b28b17d 100644 --- a/rare/components/tabs/settings/widgets/game.py +++ b/rare/components/tabs/settings/widgets/game.py @@ -5,7 +5,12 @@ from PySide6.QtGui import QHideEvent from PySide6.QtWidgets import ( QWidget, - QVBoxLayout + QVBoxLayout, + # QStackedWidget, + QGroupBox, + # QComboBox, + # QFormLayout, + # QLabel, ) from rare.shared import LegendaryCoreSingleton @@ -45,14 +50,36 @@ def __init__( self.env_vars = envvar_widget(self) if pf.system() != "Windows": + self.compat = QGroupBox(self.tr("Compatibility"), parent=self) + # self.compat_label = QLabel(self.tr("Runner")) + # self.compat_combo = QComboBox(self) + # self.compat_stack = QStackedWidget(self) + + self.compat_layout = QVBoxLayout(self.compat) + # self.compat_layout = QFormLayout(self.compat) + # self.compat_layout.setWidget(0, QFormLayout.ItemRole.LabelRole, self.compat_label) + # self.compat_layout.setWidget(0, QFormLayout.ItemRole.FieldRole, self.compat_combo) + # self.compat_layout.setWidget(1, QFormLayout.ItemRole.SpanningRole, self.compat_stack) + # self.compat_layout.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.FieldsStayAtSizeHint) + # self.wine = wine_widget(self) self.wine.environ_changed.connect(self.env_vars.reset_model) - - if pf.system() in {"Linux", "FreeBSD"}: - self.proton_tool = proton_widget(self) - self.proton_tool.environ_changed.connect(self.env_vars.reset_model) - self.proton_tool.tool_enabled.connect(self.wine.tool_enabled) - self.proton_tool.tool_enabled.connect(self.launch.tool_enabled) + self.compat_layout.addWidget(self.wine) + # wine_index = self.compat_stack.addWidget(self.wine) + # self.compat_combo.addItem("Wine", wine_index) + + if pf.system() in {"Linux", "FreeBSD"}: + self.proton_tool = proton_widget(self) + self.proton_tool.environ_changed.connect(self.env_vars.reset_model) + self.proton_tool.tool_enabled.connect(self.wine.tool_enabled) + self.proton_tool.tool_enabled.connect(self.launch.tool_enabled) + self.compat_layout.addWidget(self.proton_tool) + # proton_index = self.compat_stack.addWidget(self.proton_tool) + # self.compat_combo.addItem("Proton", proton_index) + + # self.compat_combo.currentIndexChanged.connect( + # lambda: self.compat_stack.setCurrentIndex(self.compat_combo.currentData(Qt.ItemDataRole.UserRole)) + # ) self.dxvk = dxvk_widget(self) self.dxvk.environ_changed.connect(self.env_vars.reset_model) @@ -64,9 +91,7 @@ def __init__( self.main_layout = QVBoxLayout(self) self.main_layout.addWidget(self.launch) if pf.system() != "Windows": - self.main_layout.addWidget(self.wine) - if pf.system() in {"Linux", "FreeBSD"}: - self.main_layout.addWidget(self.proton_tool) + self.main_layout.addWidget(self.compat) self.main_layout.addWidget(self.dxvk) if pf.system() in {"Linux", "FreeBSD"}: self.main_layout.addWidget(self.mangohud) diff --git a/rare/components/tabs/settings/widgets/launch.py b/rare/components/tabs/settings/widgets/launch.py index 9a4eafee8..f400c6154 100644 --- a/rare/components/tabs/settings/widgets/launch.py +++ b/rare/components/tabs/settings/widgets/launch.py @@ -21,7 +21,7 @@ def __init__( parent=None ): super(LaunchSettingsBase, self).__init__(parent=parent) - self.setTitle(self.tr("Launch settings")) + self.setTitle(self.tr("Launch")) self.core = LegendaryCoreSingleton() self.app_name: str = "default" diff --git a/rare/components/tabs/settings/widgets/overlay.py b/rare/components/tabs/settings/widgets/overlay.py index fde4b7196..eccd3ec0f 100644 --- a/rare/components/tabs/settings/widgets/overlay.py +++ b/rare/components/tabs/settings/widgets/overlay.py @@ -233,7 +233,7 @@ def showEvent(self, a0: QShowEvent): class DxvkSettings(OverlaySettings): def __init__(self, parent=None): super(DxvkSettings, self).__init__(parent=parent) - self.setTitle(self.tr("DXVK settings")) + self.setTitle(self.tr("DXVK HUD")) grid = [ OverlayCheckBox("fps", self.tr("FPS")), OverlayCheckBox("frametime", self.tr("Frametime")), @@ -285,7 +285,7 @@ def update_settings_override(self, state: ActivationStates): class MangoHudSettings(OverlaySettings): def __init__(self, parent=None): super(MangoHudSettings, self).__init__(parent=parent) - self.setTitle(self.tr("MangoHud settings")) + self.setTitle(self.tr("MangoHud")) grid = [ OverlayCheckBox("read_cfg", self.tr("Read config")), OverlayCheckBox("fps", self.tr("FPS"), default_enabled=True), diff --git a/rare/components/tabs/settings/widgets/proton.py b/rare/components/tabs/settings/widgets/proton.py index 676b19ad6..0671bdfcb 100644 --- a/rare/components/tabs/settings/widgets/proton.py +++ b/rare/components/tabs/settings/widgets/proton.py @@ -25,7 +25,7 @@ class ProtonSettings(QGroupBox): def __init__(self, parent=None): super(ProtonSettings, self).__init__(parent=parent) - self.setTitle(self.tr("Proton settings")) + self.setTitle(self.tr("Proton")) self.tool_combo = QComboBox(self) self.tool_combo.currentIndexChanged.connect(self.__on_proton_changed) diff --git a/rare/components/tabs/settings/widgets/wine.py b/rare/components/tabs/settings/widgets/wine.py index ef00b785a..90aa91bd9 100644 --- a/rare/components/tabs/settings/widgets/wine.py +++ b/rare/components/tabs/settings/widgets/wine.py @@ -2,7 +2,7 @@ from logging import getLogger from typing import Optional -from PySide6.QtCore import Signal, Qt, QSignalBlocker +from PySide6.QtCore import Signal, Qt, QSignalBlocker, Slot from PySide6.QtGui import QShowEvent from PySide6.QtWidgets import QFileDialog, QFormLayout, QGroupBox @@ -19,7 +19,7 @@ class WineSettings(QGroupBox): def __init__(self, parent=None): super(WineSettings, self).__init__(parent=parent) - self.setTitle(self.tr("Wine settings")) + self.setTitle(self.tr("Wine")) self.core = LegendaryCoreSingleton() self.signals = GlobalSignalsSingleton() @@ -62,6 +62,7 @@ def showEvent(self, a0: QShowEvent): return super().showEvent(a0) + @Slot(bool) def tool_enabled(self, enabled: bool): if enabled: config.set_boolean(self.app_name, "no_wine", True) diff --git a/rare/ui/components/tabs/settings/legendary.py b/rare/ui/components/tabs/settings/legendary.py index cd6f809ab..5e6f00344 100644 --- a/rare/ui/components/tabs/settings/legendary.py +++ b/rare/ui/components/tabs/settings/legendary.py @@ -32,7 +32,7 @@ def setupUi(self, LegendarySettings): self.left_layout.setObjectName(u"left_layout") self.install_dir_group = QGroupBox(LegendarySettings) self.install_dir_group.setObjectName(u"install_dir_group") - self.install_dir_group.setAlignment(Qt.AlignLeading|Qt.AlignLeft|Qt.AlignTop) + self.install_dir_group.setAlignment(Qt.AlignmentFlag.AlignLeading|Qt.AlignmentFlag.AlignLeft|Qt.AlignmentFlag.AlignTop) self.install_dir_layout = QVBoxLayout(self.install_dir_group) self.install_dir_layout.setObjectName(u"install_dir_layout") @@ -40,10 +40,10 @@ def setupUi(self, LegendarySettings): self.download_group = QGroupBox(LegendarySettings) self.download_group.setObjectName(u"download_group") - self.download_group.setAlignment(Qt.AlignLeading|Qt.AlignLeft|Qt.AlignTop) + self.download_group.setAlignment(Qt.AlignmentFlag.AlignLeading|Qt.AlignmentFlag.AlignLeft|Qt.AlignmentFlag.AlignTop) self.download_layout = QFormLayout(self.download_group) self.download_layout.setObjectName(u"download_layout") - self.download_layout.setLabelAlignment(Qt.AlignRight|Qt.AlignTrailing|Qt.AlignVCenter) + self.download_layout.setLabelAlignment(Qt.AlignmentFlag.AlignRight|Qt.AlignmentFlag.AlignTrailing|Qt.AlignmentFlag.AlignVCenter) self.max_workers_label = QLabel(self.download_group) self.max_workers_label.setObjectName(u"max_workers_label") sizePolicy = QSizePolicy(QSizePolicy.Policy.Maximum, QSizePolicy.Policy.Preferred) @@ -146,7 +146,7 @@ def setupUi(self, LegendarySettings): sizePolicy2.setVerticalStretch(0) sizePolicy2.setHeightForWidth(self.locale_group.sizePolicy().hasHeightForWidth()) self.locale_group.setSizePolicy(sizePolicy2) - self.locale_group.setAlignment(Qt.AlignLeading|Qt.AlignLeft|Qt.AlignTop) + self.locale_group.setAlignment(Qt.AlignmentFlag.AlignLeading|Qt.AlignmentFlag.AlignLeft|Qt.AlignmentFlag.AlignTop) self.locale_layout = QVBoxLayout(self.locale_group) self.locale_layout.setObjectName(u"locale_layout") @@ -154,7 +154,7 @@ def setupUi(self, LegendarySettings): self.cleanup_group = QGroupBox(LegendarySettings) self.cleanup_group.setObjectName(u"cleanup_group") - self.cleanup_group.setAlignment(Qt.AlignLeading|Qt.AlignLeft|Qt.AlignTop) + self.cleanup_group.setAlignment(Qt.AlignmentFlag.AlignLeading|Qt.AlignmentFlag.AlignLeft|Qt.AlignmentFlag.AlignTop) self.cleanup_layout = QVBoxLayout(self.cleanup_group) self.cleanup_layout.setObjectName(u"cleanup_layout") self.clean_keep_manifests_button = QPushButton(self.cleanup_group) @@ -225,7 +225,7 @@ def setupUi(self, LegendarySettings): # setupUi def retranslateUi(self, LegendarySettings): - self.install_dir_group.setTitle(QCoreApplication.translate("LegendarySettings", u"Default installation folder", None)) + self.install_dir_group.setTitle(QCoreApplication.translate("LegendarySettings", u"Installation folder", None)) self.download_group.setTitle(QCoreApplication.translate("LegendarySettings", u"Download settings", None)) self.max_workers_label.setText(QCoreApplication.translate("LegendarySettings", u"Max workers", None)) self.max_workers_info_label.setText(QCoreApplication.translate("LegendarySettings", u"Less is slower (0: Default)", None)) diff --git a/rare/ui/components/tabs/settings/legendary.ui b/rare/ui/components/tabs/settings/legendary.ui index 6e632c9c3..b64c71a7c 100644 --- a/rare/ui/components/tabs/settings/legendary.ui +++ b/rare/ui/components/tabs/settings/legendary.ui @@ -19,10 +19,10 @@ - Default installation folder + Installation folder - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop @@ -33,11 +33,11 @@ Download settings - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter @@ -169,7 +169,7 @@ - Qt::Vertical + Qt::Orientation::Vertical @@ -195,7 +195,7 @@ Locale - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop @@ -206,7 +206,7 @@ Cleanup - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop @@ -302,7 +302,7 @@ Disabling this greatly improves start-up time, but some library filters may not - Qt::Vertical + Qt::Orientation::Vertical