From 605c10be4a53dc29ae771818311ea5b3541c1d1f Mon Sep 17 00:00:00 2001 From: Et0h Date: Thu, 27 Aug 2015 23:16:23 +0100 Subject: [PATCH] Only show per-player args when "show more settings" is enabled --- syncplay/ui/GuiConfiguration.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/syncplay/ui/GuiConfiguration.py b/syncplay/ui/GuiConfiguration.py index a3fdb3d70..d7ddf3330 100644 --- a/syncplay/ui/GuiConfiguration.py +++ b/syncplay/ui/GuiConfiguration.py @@ -46,6 +46,7 @@ def automaticUpdatePromptCheck(self): self.automaticupdatesCheckbox.setChecked(False) def moreToggled(self): + self.setSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum) if self.moreToggling == False: self.moreToggling = True @@ -53,16 +54,21 @@ def moreToggled(self): self.tabListFrame.show() self.resetButton.show() self.nostoreCheckbox.show() + self.playerargsTextbox.show() + self.playerargsLabel.show() self.saveMoreState(True) self.tabListWidget.setCurrentRow(0) self.ensureTabListIsVisible() + self.stackedFrame.setFixedHeight(self.stackedFrame.minimumSizeHint().height()) else: self.tabListFrame.hide() self.resetButton.hide() self.nostoreCheckbox.hide() + self.playerargsTextbox.hide() + self.playerargsLabel.hide() self.saveMoreState(False) self.stackedLayout.setCurrentIndex(0) - + self.stackedFrame.setFixedHeight(self.connectionSettingsGroup.minimumSizeHint().height()+self.mediaplayerSettingsGroup.minimumSizeHint().height()+self.bottomButtonFrame.minimumSizeHint().height()+3) self.adjustSize() self.setFixedSize(self.sizeHint()) self.moreToggling = False @@ -78,8 +84,6 @@ def runButtonTextUpdate(self): def openHelp(self): self.QtGui.QDesktopServices.openUrl(QUrl("http://syncplay.pl/guide/client/")) - - def safenormcaseandpath(self, path): if utils.isURL(path): return path @@ -510,9 +514,8 @@ def addBasicTab(self): self.basicOptionsLayout.setAlignment(Qt.AlignTop) self.basicOptionsLayout.addWidget(self.connectionSettingsGroup) self.basicOptionsLayout.addSpacing(5) - self.mediaplayerSettingsGroup.setMaximumHeight(self.mediaplayerSettingsGroup.minimumSizeHint().height()) self.basicOptionsLayout.addWidget(self.mediaplayerSettingsGroup) - + self.basicOptionsFrame.setSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum) self.basicOptionsFrame.setLayout(self.basicOptionsLayout) self.stackedLayout.addWidget(self.basicOptionsFrame) @@ -934,14 +937,17 @@ def __init__(self, config, playerpaths, error, defaultConfig): self.mainLayout.addWidget(self.stackedFrame, 0, 1) self.addBottomLayout() - if self.getMoreState() == False: self.tabListFrame.hide() self.nostoreCheckbox.hide() self.resetButton.hide() + self.playerargsTextbox.hide() + self.playerargsLabel.hide() + self.stackedFrame.setFixedHeight(self.connectionSettingsGroup.minimumSizeHint().height()+self.mediaplayerSettingsGroup.minimumSizeHint().height()+self.bottomButtonFrame.minimumSizeHint().height()+3) else: self.showmoreCheckbox.setChecked(True) self.tabListWidget.setCurrentRow(0) + self.stackedFrame.setFixedHeight(self.stackedFrame.minimumSizeHint().height()) self.showmoreCheckbox.toggled.connect(self.moreToggled)