Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[processing] harmonize and improve UI spacing
- Loading branch information
|
@@ -44,7 +44,7 @@ |
|
|
from qgis.PyQt import uic |
|
|
from qgis.PyQt.QtCore import QCoreApplication, Qt |
|
|
from qgis.PyQt.QtWidgets import (QWidget, QHBoxLayout, QToolButton, |
|
|
QLabel, QCheckBox) |
|
|
QLabel, QCheckBox, QSizePolicy) |
|
|
from qgis.PyQt.QtGui import QIcon |
|
|
|
|
|
from processing.gui.DestinationSelectionPanel import DestinationSelectionPanel |
|
@@ -66,6 +66,7 @@ def __init__(self, parent, alg): |
|
|
|
|
|
self.grpAdvanced.hide() |
|
|
|
|
|
self.scrollAreaWidgetContents.setContentsMargins(4, 4, 4, 4) |
|
|
self.layoutMain = self.scrollAreaWidgetContents.layout() |
|
|
self.layoutAdvanced = self.grpAdvanced.layout() |
|
|
|
|
@@ -122,12 +123,13 @@ def initWidgets(self): |
|
|
if widget is not None: |
|
|
if isinstance(param, QgsProcessingParameterFeatureSource): |
|
|
layout = QHBoxLayout() |
|
|
layout.setSpacing(2) |
|
|
layout.setSpacing(6) |
|
|
layout.setMargin(0) |
|
|
layout.addWidget(widget) |
|
|
button = QToolButton() |
|
|
icon = QIcon(os.path.join(pluginPath, 'images', 'iterate.png')) |
|
|
button.setIcon(icon) |
|
|
button.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Expanding) |
|
|
button.setToolTip(self.tr('Iterate over this layer, creating a separate output for every feature in the layer')) |
|
|
button.setCheckable(True) |
|
|
layout.addWidget(button) |
|
@@ -139,7 +141,7 @@ def initWidgets(self): |
|
|
|
|
|
widget.setToolTip(param.toolTip()) |
|
|
|
|
|
if type(widget) is QCheckBox: |
|
|
if isinstance(widget, QCheckBox): |
|
|
# checkbox widget - so description is embedded in widget rather than a separate |
|
|
# label |
|
|
widget.setText(desc) |
|
|
|
@@ -458,7 +458,7 @@ def createWidget(self): |
|
|
layout = QHBoxLayout() |
|
|
layout.setMargin(0) |
|
|
layout.setContentsMargins(0, 0, 0, 0) |
|
|
layout.setSpacing(2) |
|
|
layout.setSpacing(6) |
|
|
layout.addWidget(self.combo) |
|
|
btn = QToolButton() |
|
|
btn.setText('…') |
|
@@ -709,7 +709,7 @@ def createWidget(self): |
|
|
layout = QHBoxLayout() |
|
|
layout.setMargin(0) |
|
|
layout.setContentsMargins(0, 0, 0, 0) |
|
|
layout.setSpacing(2) |
|
|
layout.setSpacing(6) |
|
|
self.combo = QgsMapLayerComboBox() |
|
|
layout.addWidget(self.combo) |
|
|
btn = QToolButton() |
|
@@ -751,7 +751,7 @@ def createWidget(self): |
|
|
layout = QHBoxLayout() |
|
|
layout.setMargin(0) |
|
|
layout.setContentsMargins(0, 0, 0, 0) |
|
|
layout.setSpacing(2) |
|
|
layout.setSpacing(6) |
|
|
layout.addWidget(self.combo) |
|
|
btn = QToolButton() |
|
|
btn.setText('…') |
|
@@ -878,7 +878,7 @@ def createWidget(self): |
|
|
layout = QHBoxLayout() |
|
|
layout.setMargin(0) |
|
|
layout.setContentsMargins(0, 0, 0, 0) |
|
|
layout.setSpacing(2) |
|
|
layout.setSpacing(6) |
|
|
self.combo = QgsMapLayerComboBox() |
|
|
layout.addWidget(self.combo) |
|
|
layout.setAlignment(self.combo, Qt.AlignTop) |
|
@@ -892,7 +892,7 @@ def createWidget(self): |
|
|
vl = QVBoxLayout() |
|
|
vl.setMargin(0) |
|
|
vl.setContentsMargins(0, 0, 0, 0) |
|
|
vl.setSpacing(2) |
|
|
vl.setSpacing(6) |
|
|
vl.addLayout(layout) |
|
|
|
|
|
self.use_selection_checkbox = QCheckBox(self.tr('Selected features only')) |
|
@@ -1181,7 +1181,7 @@ def createWidget(self): |
|
|
layout = QHBoxLayout() |
|
|
layout.setMargin(0) |
|
|
layout.setContentsMargins(0, 0, 0, 0) |
|
|
layout.setSpacing(2) |
|
|
layout.setSpacing(6) |
|
|
self.combo = QgsMapLayerComboBox() |
|
|
layout.addWidget(self.combo) |
|
|
btn = QToolButton() |
|
@@ -1238,7 +1238,7 @@ def createWidget(self): |
|
|
layout = QHBoxLayout() |
|
|
layout.setMargin(0) |
|
|
layout.setContentsMargins(0, 0, 0, 0) |
|
|
layout.setSpacing(2) |
|
|
layout.setSpacing(6) |
|
|
layout.addWidget(self.combo) |
|
|
btn = QToolButton() |
|
|
btn.setText('…') |
|
|
|
@@ -15,7 +15,7 @@ |
|
|
</property> |
|
|
<layout class="QHBoxLayout" name="horizontalLayout"> |
|
|
<property name="spacing"> |
|
|
<number>2</number> |
|
|
<number>6</number> |
|
|
</property> |
|
|
<property name="margin"> |
|
|
<number>0</number> |
|
@@ -39,7 +39,7 @@ |
|
|
</sizepolicy> |
|
|
</property> |
|
|
<property name="text"> |
|
|
<string>...</string> |
|
|
<string>…</string> |
|
|
</property> |
|
|
</widget> |
|
|
</item> |
|
|
|
@@ -39,7 +39,7 @@ |
|
|
</sizepolicy> |
|
|
</property> |
|
|
<property name="text"> |
|
|
<string>...</string> |
|
|
<string>…</string> |
|
|
</property> |
|
|
</widget> |
|
|
</item> |
|
@@ -48,14 +48,14 @@ |
|
|
<property name="sizePolicy"> |
|
|
<sizepolicy hsizetype="Fixed" vsizetype="Preferred"> |
|
|
<horstretch>0</horstretch> |
|
|
<verstretch>0</verstretch> |
|
|
<verstretch>1</verstretch> |
|
|
</sizepolicy> |
|
|
</property> |
|
|
<property name="toolTip"> |
|
|
<string>Iterate over this layer</string> |
|
|
</property> |
|
|
<property name="text"> |
|
|
<string>...</string> |
|
|
<string>…</string> |
|
|
</property> |
|
|
<property name="checkable"> |
|
|
<bool>true</bool> |
|
|