diff --git a/plugins/SimulationView/LayerSlider.qml b/plugins/SimulationView/LayerSlider.qml
index 42b8cf0ba0..88f298d1f5 100644
--- a/plugins/SimulationView/LayerSlider.qml
+++ b/plugins/SimulationView/LayerSlider.qml
@@ -163,9 +163,9 @@ Item
id: rangleHandleLabel
height: sliderRoot.handleSize + UM.Theme.getSize("default_margin").height
- x: parent.x + parent.width + UM.Theme.getSize("default_margin").width
+ x: parent.x - width - UM.Theme.getSize("default_margin").width
anchors.verticalCenter: parent.verticalCenter
- target: Qt.point(sliderRoot.width + width, y + height / 2)
+ target: Qt.point(sliderRoot.width, y + height / 2)
visible: sliderRoot.activeHandle == parent
// custom properties
diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml
index 862e1475a9..75a1b21186 100644
--- a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml
+++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml
@@ -12,7 +12,23 @@ Button
id: configurationItem
property var configuration: null
- hoverEnabled: true
+ hoverEnabled: isValidMaterial
+
+ property bool isValidMaterial:
+ {
+ var extruderConfigurations = configuration.extruderConfigurations
+
+ for (var index in extruderConfigurations)
+ {
+ var name = extruderConfigurations[index].material ? extruderConfigurations[index].material.name : ""
+
+ if (name == "" || name == "Unknown")
+ {
+ return false
+ }
+ }
+ return true
+ }
background: Rectangle
{
@@ -40,17 +56,92 @@ Button
right: parent.right
rightMargin: UM.Theme.getSize("wide_margin").width
}
-
+ height: childrenRect.height
spacing: UM.Theme.getSize("default_margin").width
Repeater
{
id: repeater
model: configuration.extruderConfigurations
+
delegate: PrintCoreConfiguration
{
width: Math.round(parent.width / 2)
printCoreConfiguration: modelData
+ visible: configurationItem.isValidMaterial
+ }
+ }
+
+ // Unknown material
+ Item
+ {
+ id: unknownMaterial
+ height: unknownMaterialMessage.height + UM.Theme.getSize("thin_margin").width / 2
+ width: parent.width
+
+ anchors.top: parent.top
+ anchors.topMargin: UM.Theme.getSize("thin_margin").width / 2
+
+ visible: !configurationItem.isValidMaterial
+
+ UM.RecolorImage
+ {
+ id: icon
+ anchors.verticalCenter: unknownMaterialMessage.verticalCenter
+
+ source: UM.Theme.getIcon("warning")
+ color: UM.Theme.getColor("warning")
+ width: UM.Theme.getSize("section_icon").width
+ height: width
+ }
+
+ Label
+ {
+ id: unknownMaterialMessage
+ text:
+ {
+ var extruderConfigurations = configuration.extruderConfigurations
+ var unknownMaterials = []
+ for (var index in extruderConfigurations)
+ {
+ var name = extruderConfigurations[index].material ? extruderConfigurations[index].material.name : ""
+
+ if (name == "" || name == "Unknown")
+ {
+ unknownMaterials.push(extruderConfigurations[index].material.brand ? extruderConfigurations[index].material.brand : "Unknown Brand")
+ }
+ }
+
+ unknownMaterials = "" + unknownMaterials + ""
+ var draftResult = catalog.i18nc("@label", "This configuration is not available because %1 is not recognized. Please visit %2 to download the correct material profile.");
+ var result = draftResult.arg(unknownMaterials).arg("" + catalog.i18nc("@label","Marketplace") + " ")
+
+ return result
+ }
+ width: extruderRow.width
+
+ anchors.left: icon.right
+ anchors.right: unknownMaterial.right
+ anchors.leftMargin: UM.Theme.getSize("wide_margin").height
+ anchors.top: unknownMaterial.top
+
+ wrapMode: Text.WordWrap
+ font: UM.Theme.getFont("default")
+ color: UM.Theme.getColor("text")
+ verticalAlignment: Text.AlignVCenter
+ linkColor: UM.Theme.getColor("text_link")
+
+ onLinkActivated:
+ {
+ Cura.Actions.browsePackages.trigger()
+ }
+ }
+
+ MouseArea
+ {
+ anchors.fill: parent
+ cursorShape: unknownMaterialMessage.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
+ acceptedButtons: Qt.NoButton
}
}
}
@@ -125,6 +216,9 @@ Button
onClicked:
{
- Cura.MachineManager.applyRemoteConfiguration(configuration)
+ if(isValidMaterial)
+ {
+ Cura.MachineManager.applyRemoteConfiguration(configuration);
+ }
}
}