Merge pull request #1111 from JoeXinfa/add-label

Add name label to GradientEditorItem
This commit is contained in:
Ogi Moore 2020-03-06 15:30:57 -08:00 committed by GitHub
commit 93f8ee9f0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -438,8 +438,14 @@ class GradientEditorItem(TickSliderItem):
label = QtGui.QLabel()
label.setPixmap(px)
label.setContentsMargins(1, 1, 1, 1)
labelName = QtGui.QLabel(g)
hbox = QtGui.QHBoxLayout()
hbox.addWidget(labelName)
hbox.addWidget(label)
widget = QtGui.QWidget()
widget.setLayout(hbox)
act = QtGui.QWidgetAction(self)
act.setDefaultWidget(label)
act.setDefaultWidget(widget)
act.triggered.connect(self.contextMenuClicked)
act.name = g
self.menu.addAction(act)