change color when label has changed

This commit is contained in:
zhangjie 2017-11-29 21:20:14 +08:00
parent 821ffae6b9
commit 7be0a01af8

View File

@ -607,6 +607,7 @@ class MainWindow(QMainWindow, WindowMixin):
text = self.labelDialog.popUp(item.text())
if text is not None:
item.setText(text)
item.setBackground(generateColorByText(text))
self.setDirty()
# Tzutalin 20160906 : Add file list and dock to move faster
@ -752,6 +753,7 @@ class MainWindow(QMainWindow, WindowMixin):
label = item.text()
if label != shape.label:
shape.label = item.text()
shape.line_color = generateColorByText(shape.label)
self.setDirty()
else: # User probably changed item visibility
self.canvas.setShapeVisible(shape, item.checkState() == Qt.Checked)