diff options
author | Lipu Fei <lipu.fei815@gmail.com> | 2018-02-21 13:19:18 +0300 |
---|---|---|
committer | Lipu Fei <lipu.fei815@gmail.com> | 2018-02-21 13:19:18 +0300 |
commit | c65192000e08ace9005018fe50b2f038f9c16749 (patch) | |
tree | 5814a334b0b99c1dbaf68f1216b36792fb4f64a8 /resources/qml/SidebarHeader.qml | |
parent | 628d0315421111f47b56d2bcb581af9cc464b9d1 (diff) |
WIP: Fix material name fetching in QML
Diffstat (limited to 'resources/qml/SidebarHeader.qml')
-rw-r--r-- | resources/qml/SidebarHeader.qml | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/resources/qml/SidebarHeader.qml b/resources/qml/SidebarHeader.qml index 2c99ce2dd3..b78cade1de 100644 --- a/resources/qml/SidebarHeader.qml +++ b/resources/qml/SidebarHeader.qml @@ -252,8 +252,18 @@ Column { id: materialSelection - text: Cura.MachineManager.currentRootMaterialName[base.currentExtruderIndex] - tooltip: Cura.MachineManager.currentRootMaterialName[base.currentExtruderIndex] + property var currentRootMaterialName: + { + var materials = Cura.MachineManager.currentRootMaterialName; + var materialName = ""; + if (base.currentExtruderIndex in materials) { + materialName = materials[base.currentExtruderIndex]; + } + return materialName; + } + + text: currentRootMaterialName + tooltip: currentRootMaterialName visible: Cura.MachineManager.hasMaterials enabled: !extrudersList.visible || base.currentExtruderIndex > -1 height: UM.Theme.getSize("setting_control").height |