From 7ff334ac9776581d006a311732edd878584c884f Mon Sep 17 00:00:00 2001 From: Alberto Sottile Date: Tue, 30 Apr 2019 18:03:57 +0200 Subject: [PATCH] Config dialog: fix executable input alignment on all platforms --- syncplay/ui/GuiConfiguration.py | 44 ++++++++++++++++----------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/syncplay/ui/GuiConfiguration.py b/syncplay/ui/GuiConfiguration.py index 5a162aa..069f279 100755 --- a/syncplay/ui/GuiConfiguration.py +++ b/syncplay/ui/GuiConfiguration.py @@ -608,13 +608,14 @@ class ConfigDialog(QtWidgets.QDialog): self.connectionSettingsLayout = QtWidgets.QGridLayout() self.connectionSettingsLayout.addWidget(self.hostLabel, 0, 0) - self.connectionSettingsLayout.addWidget(self.hostCombobox, 0, 1, 1, 2) + self.connectionSettingsLayout.addWidget(self.hostCombobox, 0, 1) self.connectionSettingsLayout.addWidget(self.serverpassLabel, 1, 0) - self.connectionSettingsLayout.addWidget(self.serverpassTextbox, 1, 1, 1, 2) + self.connectionSettingsLayout.addWidget(self.serverpassTextbox, 1, 1) self.connectionSettingsLayout.addWidget(self.usernameLabel, 2, 0) - self.connectionSettingsLayout.addWidget(self.usernameTextbox, 2, 1, 1, 2) + self.connectionSettingsLayout.addWidget(self.usernameTextbox, 2, 1) self.connectionSettingsLayout.addWidget(self.defaultroomLabel, 3, 0) - self.connectionSettingsLayout.addWidget(self.defaultroomTextbox, 3, 1, 1, 2) + self.connectionSettingsLayout.addWidget(self.defaultroomTextbox, 3, 1) + self.connectionSettingsLayout.setSpacing(10) self.connectionSettingsGroup.setLayout(self.connectionSettingsLayout) self.connectionSettingsGroup.setMaximumHeight(self.connectionSettingsGroup.minimumSizeHint().height()) @@ -625,13 +626,12 @@ class ConfigDialog(QtWidgets.QDialog): self.mediaplayerSettingsGroup = QtWidgets.QGroupBox(getMessage("media-setting-title")) self.executableiconImage = QtGui.QImage() self.executableiconLabel = QLabel(self) - self.executableiconLabel.setMinimumWidth(16) + self.executableiconLabel.setFixedWidth(16) self.executableiconLabel.setAlignment(Qt.AlignRight | Qt.AlignVCenter) self.executablepathCombobox = QtWidgets.QComboBox(self) self.executablepathCombobox.setEditable(True) self.executablepathCombobox.currentIndexChanged.connect(self.updateExecutableIcon) self.executablepathCombobox.setEditText(self._tryToFillPlayerPath(config['playerPath'], playerpaths)) - self.executablepathCombobox.setFixedWidth(200) self.executablepathCombobox.editTextChanged.connect(self.updateExecutableIcon) self.executablepathLabel = QLabel(getMessage("executable-path-label"), self) @@ -650,18 +650,19 @@ class ConfigDialog(QtWidgets.QDialog): self.playerargsTextbox.setObjectName(constants.LOAD_SAVE_MANUALLY_MARKER + "player-arguments") self.mediaplayerSettingsLayout = QtWidgets.QGridLayout() - self.mediaplayerSettingsLayout.addWidget(self.executablepathLabel, 0, 0) - self.mediaplayerSettingsLayout.addWidget(self.executableiconLabel, 0, 1) - self.mediaplayerSettingsLayout.addWidget(self.executablepathCombobox, 0, 2) - self.mediaplayerSettingsLayout.addWidget(self.executablebrowseButton, 0, 3) - self.mediaplayerSettingsLayout.addWidget(self.mediapathLabel, 1, 0) - self.mediaplayerSettingsLayout.addWidget(self.mediapathTextbox, 1, 2) - self.mediaplayerSettingsLayout.addWidget(self.mediabrowseButton, 1, 3) + self.mediaplayerSettingsLayout.addWidget(self.executablepathLabel, 0, 0, 1, 1) + self.mediaplayerSettingsLayout.addWidget(self.executableiconLabel, 0, 1, 1, 1) + self.mediaplayerSettingsLayout.addWidget(self.executablepathCombobox, 0, 2, 1, 1) + self.mediaplayerSettingsLayout.addWidget(self.executablebrowseButton, 0, 3, 1, 1) + self.mediaplayerSettingsLayout.addWidget(self.mediapathLabel, 1, 0, 1, 2) + self.mediaplayerSettingsLayout.addWidget(self.mediapathTextbox, 1, 2, 1, 1) + self.mediaplayerSettingsLayout.addWidget(self.mediabrowseButton, 1, 3, 1, 1) self.mediaplayerSettingsLayout.addWidget(self.playerargsLabel, 2, 0, 1, 2) self.mediaplayerSettingsLayout.addWidget(self.playerargsTextbox, 2, 2, 1, 2) + self.mediaplayerSettingsLayout.setSpacing(10) self.mediaplayerSettingsGroup.setLayout(self.mediaplayerSettingsLayout) - iconWidth = self.executableiconLabel.minimumSizeHint().width()+self.stackedLayout.spacing() + iconWidth = self.executableiconLabel.minimumSize().width()+self.mediaplayerSettingsLayout.spacing() maxWidth = max( self.hostLabel.minimumSizeHint().width(), self.usernameLabel.minimumSizeHint().width(), @@ -672,14 +673,13 @@ class ConfigDialog(QtWidgets.QDialog): 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.hostLabel.setMinimumWidth(maxWidth+iconWidth) + self.usernameLabel.setMinimumWidth(maxWidth+iconWidth) + self.serverpassLabel.setMinimumWidth(maxWidth+iconWidth) + self.defaultroomLabel.setMinimumWidth(maxWidth+iconWidth) + self.executablepathLabel.setMinimumWidth(maxWidth) + self.mediapathLabel.setMinimumWidth(maxWidth+iconWidth) + self.playerargsLabel.setMinimumWidth(maxWidth+iconWidth) self.showmoreCheckbox = QCheckBox(getMessage("more-title")) self.showmoreCheckbox.setObjectName(constants.LOAD_SAVE_MANUALLY_MARKER + "more")