Config dialog: Remove 'update list' button and tweak sizes

This commit is contained in:
Etoh 2019-04-13 15:03:41 +01:00
parent 281d8023fd
commit 554ec3361e

View File

@ -134,7 +134,7 @@ class ConfigDialog(QtWidgets.QDialog):
self.mediabrowseButton.show()
self.saveMoreState(False)
self.stackedLayout.setCurrentIndex(0)
newHeight = self.connectionSettingsGroup.minimumSizeHint().height() + self.mediaplayerSettingsGroup.minimumSizeHint().height() + self.bottomButtonFrame.minimumSizeHint().height() + 3
newHeight = self.connectionSettingsGroup.minimumSizeHint().height() + self.mediaplayerSettingsGroup.minimumSizeHint().height() + self.bottomButtonFrame.minimumSizeHint().height() + 13
if self.error:
newHeight += self.errorLabel.height()+3
self.stackedFrame.setFixedHeight(newHeight)
@ -584,11 +584,7 @@ class ConfigDialog(QtWidgets.QDialog):
i += 1
self.hostCombobox.setEditable(True)
self.hostCombobox.setEditText(host)
self.hostCombobox.setFixedWidth(250)
self.hostLabel = QLabel(getMessage("host-label"), self)
self.findServerButton = QtWidgets.QPushButton(QtGui.QIcon(resourcespath + 'arrow_refresh.png'), getMessage("update-server-list-label"))
self.findServerButton.clicked.connect(self.updateServerList)
self.findServerButton.setToolTip(getMessage("update-server-list-tooltip"))
self.usernameTextbox = QLineEdit(self)
self.usernameTextbox.setObjectName("name")
@ -610,12 +606,9 @@ class ConfigDialog(QtWidgets.QDialog):
self.defaultroomLabel.setObjectName("room")
self.defaultroomTextbox.setObjectName("room")
self.defaultroomTextbox.setMaxLength(constants.MAX_ROOM_NAME_LENGTH)
self.connectionSettingsLayout = QtWidgets.QGridLayout()
self.connectionSettingsLayout.addWidget(self.hostLabel, 0, 0)
self.connectionSettingsLayout.addWidget(self.hostCombobox, 0, 1)
self.connectionSettingsLayout.addWidget(self.findServerButton, 0, 2)
self.connectionSettingsLayout.addWidget(self.hostCombobox, 0, 1, 1, 2)
self.connectionSettingsLayout.addWidget(self.serverpassLabel, 1, 0)
self.connectionSettingsLayout.addWidget(self.serverpassTextbox, 1, 1, 1, 2)
self.connectionSettingsLayout.addWidget(self.usernameLabel, 2, 0)
@ -638,7 +631,7 @@ class ConfigDialog(QtWidgets.QDialog):
self.executablepathCombobox.setEditable(True)
self.executablepathCombobox.currentIndexChanged.connect(self.updateExecutableIcon)
self.executablepathCombobox.setEditText(self._tryToFillPlayerPath(config['playerPath'], playerpaths))
self.executablepathCombobox.setFixedWidth(330)
self.executablepathCombobox.setFixedWidth(200)
self.executablepathCombobox.editTextChanged.connect(self.updateExecutableIcon)
self.executablepathLabel = QLabel(getMessage("executable-path-label"), self)
@ -668,6 +661,26 @@ class ConfigDialog(QtWidgets.QDialog):
self.mediaplayerSettingsLayout.addWidget(self.playerargsTextbox, 2, 2, 1, 2)
self.mediaplayerSettingsGroup.setLayout(self.mediaplayerSettingsLayout)
iconWidth = self.executableiconLabel.minimumSizeHint().width()
maxWidth = max(
self.hostLabel.minimumSizeHint().width(),
self.usernameLabel.minimumSizeHint().width(),
self.serverpassLabel.minimumSizeHint().width(),
self.defaultroomLabel.minimumSizeHint().width(),
self.executablepathLabel.minimumSizeHint().width(),
self.mediapathLabel.minimumSizeHint().width(),
self.playerargsLabel.minimumSizeHint().width()
)
self.hostLabel.setFixedWidth(maxWidth+iconWidth)
self.usernameLabel.setFixedWidth(maxWidth+iconWidth)
self.serverpassLabel.setFixedWidth(maxWidth+iconWidth)
self.defaultroomLabel.setFixedWidth(maxWidth+iconWidth)
self.executablepathLabel.setFixedWidth(maxWidth-iconWidth)
self.mediapathLabel.setFixedWidth(maxWidth)
self.playerargsLabel.setFixedWidth(maxWidth)
self.showmoreCheckbox = QCheckBox(getMessage("more-title"))
self.showmoreCheckbox.setObjectName(constants.LOAD_SAVE_MANUALLY_MARKER + "more")
@ -1331,7 +1344,7 @@ class ConfigDialog(QtWidgets.QDialog):
self.mediapathTextbox.show()
self.mediapathLabel.show()
self.mediabrowseButton.show()
newHeight = self.connectionSettingsGroup.minimumSizeHint().height()+self.mediaplayerSettingsGroup.minimumSizeHint().height()+self.bottomButtonFrame.minimumSizeHint().height()+3
newHeight = self.connectionSettingsGroup.minimumSizeHint().height()+self.mediaplayerSettingsGroup.minimumSizeHint().height()+self.bottomButtonFrame.minimumSizeHint().height()+13
if self.error:
newHeight += self.errorLabel.height() + 3
self.stackedFrame.setFixedHeight(newHeight)
@ -1340,6 +1353,7 @@ class ConfigDialog(QtWidgets.QDialog):
self.tabListWidget.setCurrentRow(0)
self.stackedFrame.setFixedHeight(self.stackedFrame.minimumSizeHint().height())
self.showmoreCheckbox.toggled.connect(self.moreToggled)
self.setLayout(self.mainLayout)