Browse Source

Select label list items on shape selection

Michael Pitidis 13 năm trước cách đây
mục cha
commit
0d4ffb85df
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  1. 5 0
      labelme.py

+ 5 - 0
labelme.py

@@ -252,6 +252,11 @@ class MainWindow(QMainWindow, WindowMixin):
 
     # React to canvas signals.
     def shapeSelectionChanged(self, selected=False):
+        shape = self.canvas.selectedShape
+        if shape:
+            self.labelList.setItemSelected(self.items[shape], True)
+        else:
+            self.labelList.clearSelection()
         self.actions.delete.setEnabled(selected)
         self.actions.copy.setEnabled(selected)