mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-13 04:49:04 +08:00
Show value from definition if it is not defined in the material profile
This way you get sane defaults if no value is provided in the material xml file, instead of 0s
This commit is contained in:
parent
c97f8679c2
commit
5e50a8fe0b
@ -273,17 +273,28 @@ TabView
|
||||
{
|
||||
id: spinBox
|
||||
anchors.left: label.right
|
||||
value: (provider.properties.value != "None") ? parseFloat(provider.properties.value) : 0
|
||||
width: base.secondColumnWidth;
|
||||
value: {
|
||||
if (!isNaN(parseFloat(materialPropertyProvider.properties.value)))
|
||||
{
|
||||
return parseFloat(materialPropertyProvider.properties.value);
|
||||
}
|
||||
if (!isNaN(parseFloat(machinePropertyProvider.properties.value)))
|
||||
{
|
||||
return parseFloat(machinePropertyProvider.properties.value);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
width: base.secondColumnWidth
|
||||
readOnly: !base.editingEnabled
|
||||
suffix: " " + model.unit
|
||||
maximumValue: 99999
|
||||
decimals: model.unit == "mm" ? 2 : 0
|
||||
|
||||
onEditingFinished: provider.setPropertyValue("value", value)
|
||||
onEditingFinished: materialPropertyProvider.setPropertyValue("value", value)
|
||||
}
|
||||
|
||||
UM.ContainerPropertyProvider { id: provider; containerId: base.containerId; watchedProperties: [ "value" ]; key: model.key }
|
||||
UM.ContainerPropertyProvider { id: materialPropertyProvider; containerId: base.containerId; watchedProperties: [ "value" ]; key: model.key }
|
||||
UM.ContainerPropertyProvider { id: machinePropertyProvider; containerId: Cura.MachineManager.activeDefinitionId; watchedProperties: [ "value" ]; key: model.key }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user