Browse Source

Update current index in material dialog

CURA-4774

There is a delay so we update the current index when the model gets
changed.
Lipu Fei 7 years ago
parent
commit
93599de642
1 changed files with 9 additions and 0 deletions
  1. 9 0
      resources/qml/Preferences/MaterialsPage.qml

+ 9 - 0
resources/qml/Preferences/MaterialsPage.qml

@@ -153,6 +153,15 @@ UM.ManagementPage
                 forceActiveFocus()
                 Cura.ContainerManager.createMaterial()
             }
+
+            Connections
+            {
+                target: base.objectList.model
+                onItemsChanged:
+                {
+                    base.objectList.currentIndex = base.getIndexById(Cura.MachineManager.activeMaterialId);
+                }
+            }
         },
 
         // Duplicate button