mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-12-11 16:00:47 -07:00
Keep material selected when editing its name, brand or type
Editing a material name, brand or type may change its position in the materials list. We now reselect the material after editing one of these values.
This commit is contained in:
parent
b4f56d10d7
commit
836cf27266
2 changed files with 13 additions and 2 deletions
|
|
@ -82,7 +82,11 @@ TabView
|
||||||
width: scrollView.columnWidth;
|
width: scrollView.columnWidth;
|
||||||
text: properties.supplier;
|
text: properties.supplier;
|
||||||
readOnly: !base.editingEnabled;
|
readOnly: !base.editingEnabled;
|
||||||
onEditingFinished: base.setMetaDataEntry("brand", properties.supplier, text)
|
onEditingFinished:
|
||||||
|
{
|
||||||
|
base.setMetaDataEntry("brand", properties.supplier, text);
|
||||||
|
pane.objectList.currentIndex = pane.getIndexById(base.containerId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Label { width: scrollView.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Material Type") }
|
Label { width: scrollView.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Material Type") }
|
||||||
|
|
@ -91,7 +95,11 @@ TabView
|
||||||
width: scrollView.columnWidth;
|
width: scrollView.columnWidth;
|
||||||
text: properties.material_type;
|
text: properties.material_type;
|
||||||
readOnly: !base.editingEnabled;
|
readOnly: !base.editingEnabled;
|
||||||
onEditingFinished: base.setMetaDataEntry("material", properties.material_type, text)
|
onEditingFinished:
|
||||||
|
{
|
||||||
|
base.setMetaDataEntry("material", properties.material_type, text);
|
||||||
|
pane.objectList.currentIndex = pane.getIndexById(base.containerId)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Label { width: scrollView.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Color") }
|
Label { width: scrollView.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Color") }
|
||||||
|
|
@ -419,6 +427,7 @@ TabView
|
||||||
Cura.ContainerManager.setContainerName(base.containerId, new_value);
|
Cura.ContainerManager.setContainerName(base.containerId, new_value);
|
||||||
// update material name label. not so pretty, but it works
|
// update material name label. not so pretty, but it works
|
||||||
materialProperties.name = new_value;
|
materialProperties.name = new_value;
|
||||||
|
pane.objectList.currentIndex = pane.getIndexById(base.containerId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -227,6 +227,8 @@ UM.ManagementPage
|
||||||
|
|
||||||
properties: materialProperties
|
properties: materialProperties
|
||||||
containerId: base.currentItem != null ? base.currentItem.id : ""
|
containerId: base.currentItem != null ? base.currentItem.id : ""
|
||||||
|
|
||||||
|
property alias pane: base
|
||||||
}
|
}
|
||||||
|
|
||||||
QtObject
|
QtObject
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue