Browse Source

Update when a setting is removed from the list

Add a connection to check when a setting was or not removed from the list of the added settings in the PerObjectSettings panel.
Diego Prado Gesto 5 years ago
parent
commit
69f92ff311
1 changed files with 11 additions and 0 deletions
  1. 11 0
      plugins/PerObjectSettingsTool/PerObjectItem.qml

+ 11 - 0
plugins/PerObjectSettingsTool/PerObjectItem.qml

@@ -29,6 +29,17 @@ UM.TooltipArea
             UM.ActiveTool.forceUpdate();
         }
     }
+
+    // When the user removes settings from the list addedSettingsModel, we need to recheck if the
+    // setting is visible or not to show a mark in the CheckBox.
+    Connections
+    {
+        target: addedSettingsModel
+        onVisibleCountChanged:
+        {
+            check.checked = addedSettingsModel.getVisible(model.key)
+        }
+    }
 }