Skip to content

Commit

Permalink
[processing] Don't use separate label for checkbox parameters
Browse files Browse the repository at this point in the history
Instead embed description as checkbox label.
  • Loading branch information
nyalldawson committed Jan 9, 2017
1 parent 632f9c5 commit 0f42ea7
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions python/plugins/processing/gui/ParametersPanel.py
Expand Up @@ -123,15 +123,24 @@ def initWidgets(self):
tooltips = self.alg.getParameterDescriptions()
widget.setToolTip(tooltips.get(param.name, param.description))

label = QLabel(desc)
# label.setToolTip(tooltip)
self.labels[param.name] = label
if type(widget) is QCheckBox:
# checkbox widget - so description is embedded in widget rather than a separate
# label
widget.setText(desc)
else:
label = QLabel(desc)
# label.setToolTip(tooltip)
self.labels[param.name] = label

if param.isAdvanced:
self.layoutAdvanced.addWidget(label)
else:
self.layoutMain.insertWidget(
self.layoutMain.count() - 2, label)

if param.isAdvanced:
self.layoutAdvanced.addWidget(label)
self.layoutAdvanced.addWidget(widget)
else:
self.layoutMain.insertWidget(
self.layoutMain.count() - 2, label)
self.layoutMain.insertWidget(
self.layoutMain.count() - 2, widget)

Expand Down

0 comments on commit 0f42ea7

Please sign in to comment.