mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 07:48:59 +08:00
Fix print settings tab in materials view
CURA-8979
This commit is contained in:
parent
9ba44f1d30
commit
2dd440cc0c
@ -511,91 +511,98 @@ Item
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ListView
|
Column
|
||||||
{
|
{
|
||||||
anchors
|
visible: pageSelectorTabRow.currentItem.activeView === "settings"
|
||||||
{
|
spacing: UM.Theme.getSize("narrow_margin").height
|
||||||
top: pageSelectorTabRow.bottom
|
anchors.fill: parent
|
||||||
left: parent.left
|
anchors.topMargin: UM.Theme.getSize("thin_margin").height
|
||||||
right: parent.right
|
anchors.bottomMargin: UM.Theme.getSize("thin_margin").height
|
||||||
bottom: parent.bottom
|
anchors.leftMargin: UM.Theme.getSize("thin_margin").width
|
||||||
}
|
anchors.rightMargin: UM.Theme.getSize("thin_margin").width
|
||||||
|
|
||||||
model: UM.SettingDefinitionsModel
|
|
||||||
{
|
|
||||||
containerId: Cura.MachineManager.activeMachine != null ? Cura.MachineManager.activeMachine.definition.id: ""
|
|
||||||
visibilityHandler: Cura.MaterialSettingsVisibilityHandler { }
|
|
||||||
expanded: ["*"]
|
|
||||||
}
|
|
||||||
ScrollBar.vertical: UM.ScrollBar {}
|
ScrollBar.vertical: UM.ScrollBar {}
|
||||||
clip: true
|
clip: true
|
||||||
visible: pageSelectorTabRow.currentItem.activeView === "settings"
|
|
||||||
|
|
||||||
delegate: UM.TooltipArea
|
Repeater
|
||||||
{
|
{
|
||||||
width: childrenRect.width
|
model: UM.SettingDefinitionsModel
|
||||||
height: childrenRect.height
|
|
||||||
text: model.description
|
|
||||||
UM.Label
|
|
||||||
{
|
{
|
||||||
id: label
|
|
||||||
width: base.firstColumnWidth;
|
|
||||||
height: spinBox.height + UM.Theme.getSize("default_lining").height
|
|
||||||
text: model.label
|
|
||||||
elide: Text.ElideRight
|
|
||||||
verticalAlignment: Qt.AlignVCenter
|
|
||||||
}
|
|
||||||
Cura.SpinBox
|
|
||||||
{
|
|
||||||
id: spinBox
|
|
||||||
anchors.left: label.right
|
|
||||||
value:
|
|
||||||
{
|
|
||||||
// In case the setting is not in the material...
|
|
||||||
if (!isNaN(parseFloat(materialPropertyProvider.properties.value)))
|
|
||||||
{
|
|
||||||
return parseFloat(materialPropertyProvider.properties.value);
|
|
||||||
}
|
|
||||||
// ... we search in the variant, and if it is not there...
|
|
||||||
if (!isNaN(parseFloat(variantPropertyProvider.properties.value)))
|
|
||||||
{
|
|
||||||
return parseFloat(variantPropertyProvider.properties.value);
|
|
||||||
}
|
|
||||||
// ... then look in the definition container.
|
|
||||||
if (!isNaN(parseFloat(machinePropertyProvider.properties.value)))
|
|
||||||
{
|
|
||||||
return parseFloat(machinePropertyProvider.properties.value);
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
width: base.secondColumnWidth
|
|
||||||
suffix: " " + model.unit
|
|
||||||
to: 99999
|
|
||||||
decimals: model.unit == "mm" ? 2 : 0
|
|
||||||
|
|
||||||
onEditingFinished: materialPropertyProvider.setPropertyValue("value", value)
|
|
||||||
}
|
|
||||||
|
|
||||||
UM.ContainerPropertyProvider
|
|
||||||
{
|
|
||||||
id: materialPropertyProvider
|
|
||||||
containerId: base.containerId
|
|
||||||
watchedProperties: [ "value" ]
|
|
||||||
key: model.key
|
|
||||||
}
|
|
||||||
UM.ContainerPropertyProvider
|
|
||||||
{
|
|
||||||
id: variantPropertyProvider
|
|
||||||
containerId: Cura.MachineManager.activeStack.variant.id
|
|
||||||
watchedProperties: [ "value" ]
|
|
||||||
key: model.key
|
|
||||||
}
|
|
||||||
UM.ContainerPropertyProvider
|
|
||||||
{
|
|
||||||
id: machinePropertyProvider
|
|
||||||
containerId: Cura.MachineManager.activeMachine != null ? Cura.MachineManager.activeMachine.definition.id: ""
|
containerId: Cura.MachineManager.activeMachine != null ? Cura.MachineManager.activeMachine.definition.id: ""
|
||||||
watchedProperties: [ "value" ]
|
visibilityHandler: Cura.MaterialSettingsVisibilityHandler { }
|
||||||
key: model.key
|
expanded: ["*"]
|
||||||
|
}
|
||||||
|
|
||||||
|
delegate: UM.TooltipArea
|
||||||
|
{
|
||||||
|
width: childrenRect.width
|
||||||
|
height: childrenRect.height
|
||||||
|
|
||||||
|
UM.TooltipArea
|
||||||
|
{
|
||||||
|
anchors.fill: parent
|
||||||
|
text: model.description
|
||||||
|
}
|
||||||
|
UM.Label
|
||||||
|
{
|
||||||
|
id: label
|
||||||
|
width: base.firstColumnWidth;
|
||||||
|
height: spinBox.height + UM.Theme.getSize("default_lining").height
|
||||||
|
text: model.label
|
||||||
|
elide: Text.ElideRight
|
||||||
|
verticalAlignment: Qt.AlignVCenter
|
||||||
|
}
|
||||||
|
Cura.SpinBox
|
||||||
|
{
|
||||||
|
id: spinBox
|
||||||
|
anchors.left: label.right
|
||||||
|
value:
|
||||||
|
{
|
||||||
|
// In case the setting is not in the material...
|
||||||
|
if (!isNaN(parseFloat(materialPropertyProvider.properties.value)))
|
||||||
|
{
|
||||||
|
return parseFloat(materialPropertyProvider.properties.value);
|
||||||
|
}
|
||||||
|
// ... we search in the variant, and if it is not there...
|
||||||
|
if (!isNaN(parseFloat(variantPropertyProvider.properties.value)))
|
||||||
|
{
|
||||||
|
return parseFloat(variantPropertyProvider.properties.value);
|
||||||
|
}
|
||||||
|
// ... then look in the definition container.
|
||||||
|
if (!isNaN(parseFloat(machinePropertyProvider.properties.value)))
|
||||||
|
{
|
||||||
|
return parseFloat(machinePropertyProvider.properties.value);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
width: base.secondColumnWidth
|
||||||
|
suffix: " " + model.unit
|
||||||
|
to: 99999
|
||||||
|
decimals: model.unit == "mm" ? 2 : 0
|
||||||
|
|
||||||
|
onEditingFinished: materialPropertyProvider.setPropertyValue("value", value)
|
||||||
|
}
|
||||||
|
|
||||||
|
UM.ContainerPropertyProvider
|
||||||
|
{
|
||||||
|
id: materialPropertyProvider
|
||||||
|
containerId: base.containerId
|
||||||
|
watchedProperties: [ "value" ]
|
||||||
|
key: model.key
|
||||||
|
}
|
||||||
|
UM.ContainerPropertyProvider
|
||||||
|
{
|
||||||
|
id: variantPropertyProvider
|
||||||
|
containerId: Cura.MachineManager.activeStack.variant.id
|
||||||
|
watchedProperties: [ "value" ]
|
||||||
|
key: model.key
|
||||||
|
}
|
||||||
|
UM.ContainerPropertyProvider
|
||||||
|
{
|
||||||
|
id: machinePropertyProvider
|
||||||
|
containerId: Cura.MachineManager.activeMachine != null ? Cura.MachineManager.activeMachine.definition.id: ""
|
||||||
|
watchedProperties: ["value"]
|
||||||
|
key: model.key
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user