Merge pull request #207 from luoyetx/color

change color when label has changed
This commit is contained in:
darrenl
2017-11-30 16:58:09 +08:00
committed by GitHub
+2
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)