Allow default button for text and colormap parameters

This commit is contained in:
Daniel Lidstrom 2020-12-17 09:52:51 -08:00
parent edf42114f8
commit db43c9447c

View File

@ -63,8 +63,9 @@ class WidgetParameterItem(ParameterItem):
layout = QtGui.QHBoxLayout() layout = QtGui.QHBoxLayout()
layout.setContentsMargins(0, 0, 0, 0) layout.setContentsMargins(0, 0, 0, 0)
layout.setSpacing(2) layout.setSpacing(2)
layout.addWidget(w) layout.addWidget(w, 1)
layout.addWidget(self.displayLabel) layout.addWidget(self.displayLabel, 1)
layout.addStretch(0)
layout.addWidget(self.defaultBtn) layout.addWidget(self.defaultBtn)
self.layoutWidget = QtGui.QWidget() self.layoutWidget = QtGui.QWidget()
self.layoutWidget.setLayout(layout) self.layoutWidget.setLayout(layout)
@ -279,7 +280,6 @@ class WidgetParameterItem(ParameterItem):
if self.asSubItem: if self.asSubItem:
tree.setFirstItemColumnSpanned(self.subItem, True) tree.setFirstItemColumnSpanned(self.subItem, True)
tree.setItemWidget(self.subItem, 0, self.widget) tree.setItemWidget(self.subItem, 0, self.widget)
else:
tree.setItemWidget(self, 1, self.layoutWidget) tree.setItemWidget(self, 1, self.layoutWidget)
self.displayLabel.hide() self.displayLabel.hide()
self.selected(False) self.selected(False)