1
0
Fork 0
mirror of synced 2024-06-23 08:40:45 +12:00

InstallDialog: Add install_dir_edit widget without using an extra layout

This commit is contained in:
loathingKernel 2023-12-11 13:21:19 +02:00
parent 0d62965edb
commit 8c83f8aa23
No known key found for this signature in database
GPG key ID: CE0C72D0B53821FD
3 changed files with 9 additions and 12 deletions

View file

@ -6,7 +6,7 @@ from typing import Tuple, List, Union, Optional
from PyQt5.QtCore import Qt, QThreadPool, QSettings, QCoreApplication
from PyQt5.QtCore import pyqtSignal, pyqtSlot
from PyQt5.QtGui import QCloseEvent, QKeyEvent, QShowEvent
from PyQt5.QtWidgets import QDialog, QFileDialog, QCheckBox, QLayout, QWidget, QVBoxLayout
from PyQt5.QtWidgets import QDialog, QFileDialog, QCheckBox, QLayout, QWidget, QVBoxLayout, QFormLayout
from legendary.utils.selective_dl import get_sdl_appname
from rare.models.game import RareGame
@ -85,7 +85,10 @@ class InstallDialog(QDialog):
save_func=self.save_install_edit,
parent=self,
)
self.ui.install_dir_layout.addWidget(self.install_dir_edit)
self.ui.install_dialog_layout.setWidget(
self.ui.install_dialog_layout.indexOf(self.ui.install_dir_label),
QFormLayout.FieldRole, self.install_dir_edit
)
if self.options.update:
self.ui.install_dir_label.setEnabled(False)

View file

@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'rare/ui/components/dialogs/install_dialog.ui'
#
# Created by: PyQt5 UI code generator 5.15.9
# Created by: PyQt5 UI code generator 5.15.10
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
@ -14,7 +14,7 @@ from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_InstallDialog(object):
def setupUi(self, InstallDialog):
InstallDialog.setObjectName("InstallDialog")
InstallDialog.resize(324, 232)
InstallDialog.resize(272, 238)
InstallDialog.setWindowTitle("InstallDialog")
self.install_dialog_layout = QtWidgets.QFormLayout(InstallDialog)
self.install_dialog_layout.setLabelAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
@ -25,9 +25,6 @@ class Ui_InstallDialog(object):
self.install_dir_label = QtWidgets.QLabel(InstallDialog)
self.install_dir_label.setObjectName("install_dir_label")
self.install_dialog_layout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.install_dir_label)
self.install_dir_layout = QtWidgets.QHBoxLayout()
self.install_dir_layout.setObjectName("install_dir_layout")
self.install_dialog_layout.setLayout(1, QtWidgets.QFormLayout.FieldRole, self.install_dir_layout)
self.platform_label = QtWidgets.QLabel(InstallDialog)
self.platform_label.setObjectName("platform_label")
self.install_dialog_layout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.platform_label)

View file

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>324</width>
<height>232</height>
<width>272</width>
<height>238</height>
</rect>
</property>
<property name="windowTitle">
@ -31,9 +31,6 @@
</property>
</widget>
</item>
<item row="1" column="1">
<layout class="QHBoxLayout" name="install_dir_layout"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="platform_label">
<property name="text">