From 57dd6027bd0a5c08fdd68045bb21bca9ba17c7f5 Mon Sep 17 00:00:00 2001 From: falkTX Date: Mon, 2 Oct 2017 01:19:00 +0200 Subject: [PATCH] Place more parameters per tab in editor dialog --- resources/ui/carla_edit.ui | 164 +++++++++++++++++++++----------- resources/ui/carla_parameter.ui | 7 +- source/carla_widgets.py | 12 ++- 3 files changed, 122 insertions(+), 61 deletions(-) diff --git a/resources/ui/carla_edit.ui b/resources/ui/carla_edit.ui index 82b4aa725..4c19c5a2b 100644 --- a/resources/ui/carla_edit.ui +++ b/resources/ui/carla_edit.ui @@ -6,8 +6,8 @@ 0 0 - 509 - 443 + 758 + 435 @@ -440,12 +440,12 @@ Qt::Horizontal - QSizePolicy::Fixed + QSizePolicy::Expanding - 10 - 20 + 1 + 1 @@ -471,47 +471,19 @@ Plugin Name Qt::Horizontal - QSizePolicy::Fixed + QSizePolicy::Expanding - 10 - 20 + 1 + 1 - - - - Qt::NoFocus - - - Save State - - - - :/16x16/document-save.png:/16x16/document-save.png - - - - - - - Qt::NoFocus - - - Load State - - - - :/16x16/document-open.png:/16x16/document-open.png - - - - + @@ -527,6 +499,22 @@ Plugin Name + + 2 + + + + + Qt::Horizontal + + + + 1 + 1 + + + + @@ -554,6 +542,25 @@ Plugin Name + + 2 + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 1 + 1 + + + + @@ -581,6 +588,50 @@ Plugin Name + + + + Qt::NoFocus + + + Save State + + + + :/16x16/document-save.png:/16x16/document-save.png + + + + + + + Qt::NoFocus + + + Load State + + + + :/16x16/document-open.png:/16x16/document-open.png + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 1 + 1 + + + + @@ -651,22 +702,6 @@ Plugin Name - - - - - - - - - - false - - - true - - - @@ -755,6 +790,22 @@ Plugin Name + + + + + + + + + + false + + + true + + + @@ -765,10 +816,13 @@ Plugin Name Qt::Vertical + + QSizePolicy::MinimumExpanding + - 20 - 40 + 1 + 1 diff --git a/resources/ui/carla_parameter.ui b/resources/ui/carla_parameter.ui index 8f6a32a13..dc6b60887 100644 --- a/resources/ui/carla_parameter.ui +++ b/resources/ui/carla_parameter.ui @@ -6,14 +6,17 @@ 0 0 - 452 - 34 + 369 + 22 Form + + 0 + diff --git a/source/carla_widgets.py b/source/carla_widgets.py index 3fb97dc1c..6f44b0c9d 100755 --- a/source/carla_widgets.py +++ b/source/carla_widgets.py @@ -431,7 +431,7 @@ class PluginEditParentMeta(): class PluginEdit(QDialog): # settings - kParamsPerPage = 8 + kParamsPerPage = 17 # signals SIGTERM = pyqtSignal() @@ -720,7 +720,10 @@ class PluginEdit(QDialog): @pyqtSlot() def slot_fixNameWordWrap(self): + if self.ui.tabWidget.count() > 0: + self.ui.tabWidget.setCurrentIndex(1) self.adjustSize() + self.ui.tabWidget.setCurrentIndex(0) self.setMinimumSize(self.width(), self.height()) #------------------------------------------------------------------ @@ -874,7 +877,7 @@ class PluginEdit(QDialog): #parameter['name'] = parameter['name'][:30] + (parameter['name'][30:] and "...") # ----------------------------------------------------------------- - # Get width values, in packs of 10 + # Get width values, in packs of 20 if parameter['type'] == PARAMETER_INPUT: paramInputWidthTMP = QFontMetrics(self.font()).width(parameter['name']) @@ -905,10 +908,10 @@ class PluginEdit(QDialog): # for i in range(parameterCount) else: # Final page width values - if 0 < len(paramInputList) < 10: + if 0 < len(paramInputList) < self.kParamsPerPage: paramInputListFull.append((paramInputList, paramInputWidth)) - if 0 < len(paramOutputList) < 10: + if 0 < len(paramOutputList) < self.kParamsPerPage: paramOutputListFull.append((paramOutputList, paramOutputWidth)) # Create parameter tabs + widgets @@ -1491,6 +1494,7 @@ class PluginEdit(QDialog): tabIndex = self.ui.tabWidget.count() tabPageContainer = QWidget(self.ui.tabWidget) tabPageLayout = QVBoxLayout(tabPageContainer) + tabPageLayout.setSpacing(1) tabPageContainer.setLayout(tabPageLayout) for paramInfo in paramList: