mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-16 03:07:53 -06:00
Set the new metadata when editing a material
Contributes to CURA-342
This commit is contained in:
parent
ded4c89cb5
commit
eb48a4e768
1 changed files with 28 additions and 3 deletions
|
@ -45,10 +45,23 @@ TabView
|
||||||
property real rowHeight: textField.height;
|
property real rowHeight: textField.height;
|
||||||
|
|
||||||
Label { width: base.firstColumnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Brand") }
|
Label { width: base.firstColumnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Brand") }
|
||||||
TextField { id: textField; width: base.secondColumnWidth; text: properties.supplier; readOnly: !base.editingEnabled; }
|
TextField
|
||||||
|
{
|
||||||
|
id: textField;
|
||||||
|
width: base.secondColumnWidth;
|
||||||
|
text: properties.supplier;
|
||||||
|
readOnly: !base.editingEnabled;
|
||||||
|
onEditingFinished: Cura.ContainerManager.setContainerMetaDataEntry(base.containerId, "brand", text)
|
||||||
|
}
|
||||||
|
|
||||||
Label { width: base.firstColumnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Material Type") }
|
Label { width: base.firstColumnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Material Type") }
|
||||||
TextField { width: base.secondColumnWidth; text: properties.material_type; readOnly: !base.editingEnabled; }
|
TextField
|
||||||
|
{
|
||||||
|
width: base.secondColumnWidth;
|
||||||
|
text: properties.material_type;
|
||||||
|
readOnly: !base.editingEnabled;
|
||||||
|
onEditingFinished: Cura.ContainerManager.setContainerMetaDataEntry(base.containerId, "material", text)
|
||||||
|
}
|
||||||
|
|
||||||
Label { width: base.firstColumnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Color") }
|
Label { width: base.firstColumnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Color") }
|
||||||
|
|
||||||
|
@ -62,6 +75,8 @@ TabView
|
||||||
{
|
{
|
||||||
id: colorSelector
|
id: colorSelector
|
||||||
color: properties.color_code
|
color: properties.color_code
|
||||||
|
onColorChanged: Cura.ContainerManager.setContainerMetaDataEntry(base.containerId, "color_code", color)
|
||||||
|
|
||||||
width: colorLabel.height * 0.75
|
width: colorLabel.height * 0.75
|
||||||
height: colorLabel.height * 0.75
|
height: colorLabel.height * 0.75
|
||||||
border.width: UM.Theme.getSize("default_lining").height
|
border.width: UM.Theme.getSize("default_lining").height
|
||||||
|
@ -70,7 +85,13 @@ TabView
|
||||||
|
|
||||||
MouseArea { anchors.fill: parent; onClicked: colorDialog.open(); enabled: base.editingEnabled }
|
MouseArea { anchors.fill: parent; onClicked: colorDialog.open(); enabled: base.editingEnabled }
|
||||||
}
|
}
|
||||||
TextField { id: colorLabel; text: properties.color_name; readOnly: !base.editingEnabled }
|
TextField
|
||||||
|
{
|
||||||
|
id: colorLabel;
|
||||||
|
text: properties.color_name;
|
||||||
|
readOnly: !base.editingEnabled
|
||||||
|
onEditingFinished: Cura.ContainerManager.setContainerMetaDataEntry(base.containerId, "color_name", text)
|
||||||
|
}
|
||||||
|
|
||||||
ColorDialog { id: colorDialog; color: properties.color_code; onAccepted: colorSelector.color = color }
|
ColorDialog { id: colorDialog; color: properties.color_code; onAccepted: colorSelector.color = color }
|
||||||
}
|
}
|
||||||
|
@ -88,6 +109,8 @@ TabView
|
||||||
suffix: "g/cm"
|
suffix: "g/cm"
|
||||||
stepSize: 0.01
|
stepSize: 0.01
|
||||||
readOnly: !base.editingEnabled;
|
readOnly: !base.editingEnabled;
|
||||||
|
|
||||||
|
onEditingFinished: Cura.ContainerManager.setContainerMetaDataEntry(base.containerId, "properties/density", value)
|
||||||
}
|
}
|
||||||
|
|
||||||
Label { width: base.firstColumnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Diameter") }
|
Label { width: base.firstColumnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Diameter") }
|
||||||
|
@ -99,6 +122,8 @@ TabView
|
||||||
suffix: "mm³"
|
suffix: "mm³"
|
||||||
stepSize: 0.01
|
stepSize: 0.01
|
||||||
readOnly: !base.editingEnabled;
|
readOnly: !base.editingEnabled;
|
||||||
|
|
||||||
|
onEditingFinished: Cura.ContainerManager.setContainerMetaDataEntry(base.containerId, "properties/diameter", value)
|
||||||
}
|
}
|
||||||
|
|
||||||
Label { width: base.firstColumnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Filament Cost") }
|
Label { width: base.firstColumnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Filament Cost") }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue