|
@@ -1074,8 +1074,14 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
shape.label = text
|
|
shape.label = text
|
|
shape.flags = flags
|
|
shape.flags = flags
|
|
shape.group_id = group_id
|
|
shape.group_id = group_id
|
|
|
|
+
|
|
|
|
+ self._update_shape_color(shape)
|
|
if shape.group_id is None:
|
|
if shape.group_id is None:
|
|
- item.setText(shape.label)
|
|
|
|
|
|
+ item.setText(
|
|
|
|
+ '{} <font color="#{:02x}{:02x}{:02x}">●</font>'.format(
|
|
|
|
+ shape.label, *shape.fill_color.getRgb()[:3]
|
|
|
|
+ )
|
|
|
|
+ )
|
|
else:
|
|
else:
|
|
item.setText("{} ({})".format(shape.label, shape.group_id))
|
|
item.setText("{} ({})".format(shape.label, shape.group_id))
|
|
self.setDirty()
|
|
self.setDirty()
|
|
@@ -1141,14 +1147,15 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
for action in self.actions.onShapesPresent:
|
|
for action in self.actions.onShapesPresent:
|
|
action.setEnabled(True)
|
|
action.setEnabled(True)
|
|
|
|
|
|
- rgb = self._get_rgb_by_label(shape.label)
|
|
|
|
-
|
|
|
|
- r, g, b = rgb
|
|
|
|
|
|
+ self._update_shape_color(shape)
|
|
label_list_item.setText(
|
|
label_list_item.setText(
|
|
'{} <font color="#{:02x}{:02x}{:02x}">●</font>'.format(
|
|
'{} <font color="#{:02x}{:02x}{:02x}">●</font>'.format(
|
|
- text, r, g, b
|
|
|
|
|
|
+ text, *shape.fill_color.getRgb()[:3]
|
|
)
|
|
)
|
|
)
|
|
)
|
|
|
|
+
|
|
|
|
+ def _update_shape_color(self, shape):
|
|
|
|
+ r, g, b = self._get_rgb_by_label(shape.label)
|
|
shape.line_color = QtGui.QColor(r, g, b)
|
|
shape.line_color = QtGui.QColor(r, g, b)
|
|
shape.vertex_fill_color = QtGui.QColor(r, g, b)
|
|
shape.vertex_fill_color = QtGui.QColor(r, g, b)
|
|
shape.hvertex_fill_color = QtGui.QColor(255, 255, 255)
|
|
shape.hvertex_fill_color = QtGui.QColor(255, 255, 255)
|