mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-09 23:05:01 -06: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;
|
||||
text: properties.supplier;
|
||||
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") }
|
||||
|
@ -91,7 +95,11 @@ TabView
|
|||
width: scrollView.columnWidth;
|
||||
text: properties.material_type;
|
||||
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") }
|
||||
|
@ -419,6 +427,7 @@ TabView
|
|||
Cura.ContainerManager.setContainerName(base.containerId, new_value);
|
||||
// update material name label. not so pretty, but it works
|
||||
materialProperties.name = new_value;
|
||||
pane.objectList.currentIndex = pane.getIndexById(base.containerId)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -227,6 +227,8 @@ UM.ManagementPage
|
|||
|
||||
properties: materialProperties
|
||||
containerId: base.currentItem != null ? base.currentItem.id : ""
|
||||
|
||||
property alias pane: base
|
||||
}
|
||||
|
||||
QtObject
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue