diff --git a/cura/Machines/Models/ExtrudersModel.py b/cura/Machines/Models/ExtrudersModel.py index 1aba1d871a..5ae3c19874 100644 --- a/cura/Machines/Models/ExtrudersModel.py +++ b/cura/Machines/Models/ExtrudersModel.py @@ -59,6 +59,8 @@ class ExtrudersModel(ListModel): defaultColors = ["#ffc924", "#86ec21", "#22eeee", "#245bff", "#9124ff", "#ff24c8"] """List of colours to display if there is no material or the material has no known colour. """ + MaterialNameRole = Qt.UserRole + 13 + def __init__(self, parent = None): """Initialises the extruders model, defining the roles and listening for changes in the data. @@ -79,6 +81,7 @@ class ExtrudersModel(ListModel): self.addRoleName(self.MaterialBrandRole, "material_brand") self.addRoleName(self.ColorNameRole, "color_name") self.addRoleName(self.MaterialTypeRole, "material_type") + self.addRoleName(self.MaterialNameRole, "material_name") self._update_extruder_timer = QTimer() self._update_extruder_timer.setInterval(100) self._update_extruder_timer.setSingleShot(True) @@ -199,8 +202,8 @@ class ExtrudersModel(ListModel): "material_brand": material_brand, "color_name": color_name, "material_type": extruder.material.getMetaDataEntry("material") if extruder.material else "", + "material_name": extruder.material.getMetaDataEntry("name") if extruder.material else "", } - items.append(item) extruders_changed = True @@ -224,6 +227,7 @@ class ExtrudersModel(ListModel): "material_brand": "", "color_name": "", "material_type": "", + "material_label": "" } items.append(item) if self._items != items: diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml index e9c706334a..b23a8c0811 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml @@ -79,9 +79,9 @@ Cura.ExpandablePopup // Label for the brand of the material Label { - id: materialBrandColorTypeLabel + id: materialBrandNameLabel - text: model.material_brand == model.color_name ? model.color_name + " " + model.material_type : model.material_brand + " " + model.color_name + " " + model.material_type + text: model.material_brand + " " + model.material_name elide: Text.ElideRight font: UM.Theme.getFont("default") color: UM.Theme.getColor("text") @@ -92,15 +92,15 @@ Cura.ExpandablePopup Label { - id: materialColorTypeLabel + id: materialNameLabel - text: model.color_name + " " + model.material_type + text: model.material_name elide: Text.ElideRight font: UM.Theme.getFont("default") color: UM.Theme.getColor("text") renderType: Text.NativeRendering width: parent.width - visible: !materialBrandColorTypeLabel.visible && !truncated + visible: !materialBrandNameLabel.visible && !truncated } Label @@ -113,7 +113,7 @@ Cura.ExpandablePopup color: UM.Theme.getColor("text") renderType: Text.NativeRendering width: parent.width - visible: !materialBrandColorTypeLabel.visible && !materialColorTypeLabel.visible + visible: !materialBrandNameLabel.visible && !materialNameLabel.visible } // Label that shows the name of the variant Label