From 6b01d85fb13d07830f1c3f0d543793cc57bf715e Mon Sep 17 00:00:00 2001 From: HellAholic Date: Wed, 19 Nov 2025 09:54:41 +0100 Subject: [PATCH 1/5] Add warning icons for extruder visibility in SimulationView Introduces warning icons in the SimulationView menu to indicate when extruder visibility is low or unchecked. Updates layout logic to accommodate the new icons and increments the plugin version to 1.0.2. --- .../SimulationViewMenuComponent.qml | 53 ++++++++++++++++--- plugins/SimulationView/plugin.json | 2 +- 2 files changed, 46 insertions(+), 9 deletions(-) diff --git a/plugins/SimulationView/SimulationViewMenuComponent.qml b/plugins/SimulationView/SimulationViewMenuComponent.qml index 78b0b2b74f..93bafd4bcd 100644 --- a/plugins/SimulationView/SimulationViewMenuComponent.qml +++ b/plugins/SimulationView/SimulationViewMenuComponent.qml @@ -53,17 +53,38 @@ Cura.ExpandableComponent UM.Label { + id: lineTypeLabel text: layerTypeCombobox.currentText - anchors - { - left: colorSchemeLabel.right - leftMargin: UM.Theme.getSize("default_margin").width - right: parent.right - } + anchors.left: colorSchemeLabel.right + anchors.leftMargin: UM.Theme.getSize("default_margin").width height: parent.height elide: Text.ElideRight font: UM.Theme.getFont("medium") } + + UM.ColorImage + { + id: warningIcon + anchors + { + left: lineTypeLabel.right + leftMargin: UM.Theme.getSize("narrow_margin").width + verticalCenter: parent.verticalCenter + } + width: UM.Theme.getSize("section_icon").width + height: UM.Theme.getSize("section_icon").height + source: UM.Theme.getIcon("Warning") + color: UM.Theme.getColor("warning") + visible: { + // Check if any extruder is unchecked + for (var i = 0; i < viewSettings.extruder_opacities.length; i++) { + if (viewSettings.extruder_opacities[i] <= 0.5 && viewSettings.extruder_opacities[i] !== undefined && viewSettings.extruder_opacities[i] !== "") { + return true; + } + } + return false; + } + } } contentItem: Column @@ -212,11 +233,27 @@ Cura.ExpandableComponent { verticalCenter: parent.verticalCenter left: extrudersModelCheckBox.left - right: extrudersModelCheckBox.right + right: extruderWarningIcon.visible ? extruderWarningIcon.left : swatch.left leftMargin: UM.Theme.getSize("checkbox").width + Math.round(UM.Theme.getSize("default_margin").width / 2) - rightMargin: UM.Theme.getSize("default_margin").width * 2 + rightMargin: UM.Theme.getSize("narrow_margin").width } } + + UM.ColorImage + { + id: extruderWarningIcon + anchors + { + verticalCenter: parent.verticalCenter + right: swatch.left + rightMargin: UM.Theme.getSize("narrow_margin").width + } + width: UM.Theme.getSize("section_icon").width + height: UM.Theme.getSize("section_icon").height + source: UM.Theme.getIcon("Warning") + color: UM.Theme.getColor("warning") + visible: !extrudersModelCheckBox.checked + } } } diff --git a/plugins/SimulationView/plugin.json b/plugins/SimulationView/plugin.json index 7e7561e5c0..a69282796b 100644 --- a/plugins/SimulationView/plugin.json +++ b/plugins/SimulationView/plugin.json @@ -1,7 +1,7 @@ { "name": "Simulation View", "author": "Ultimaker B.V.", - "version": "1.0.1", + "version": "1.0.2", "description": "Provides the preview of sliced layerdata.", "api": 8, "i18n-catalog": "cura" From 932f139c95ee31ecd62ac9e552df5eba46a29d26 Mon Sep 17 00:00:00 2001 From: HellAholic Date: Wed, 19 Nov 2025 09:58:42 +0100 Subject: [PATCH 2/5] Rename lineTypeLabel to SchemeTypeLabel Updated the id from lineTypeLabel to SchemeTypeLabel and adjusted references accordingly for clarity and consistency in SimulationViewMenuComponent.qml. --- plugins/SimulationView/SimulationViewMenuComponent.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/SimulationView/SimulationViewMenuComponent.qml b/plugins/SimulationView/SimulationViewMenuComponent.qml index 93bafd4bcd..98467a085d 100644 --- a/plugins/SimulationView/SimulationViewMenuComponent.qml +++ b/plugins/SimulationView/SimulationViewMenuComponent.qml @@ -53,7 +53,7 @@ Cura.ExpandableComponent UM.Label { - id: lineTypeLabel + id: SchemeTypeLabel text: layerTypeCombobox.currentText anchors.left: colorSchemeLabel.right anchors.leftMargin: UM.Theme.getSize("default_margin").width @@ -67,7 +67,7 @@ Cura.ExpandableComponent id: warningIcon anchors { - left: lineTypeLabel.right + left: SchemeTypeLabel.right leftMargin: UM.Theme.getSize("narrow_margin").width verticalCenter: parent.verticalCenter } From 851ba0e04b4484ff67054d2416b31af7559ab23f Mon Sep 17 00:00:00 2001 From: HellAholic Date: Wed, 19 Nov 2025 10:02:04 +0100 Subject: [PATCH 3/5] Rename SchemeTypeLabel to schemeTypeLabel id should start with lowercase --- plugins/SimulationView/SimulationViewMenuComponent.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/SimulationView/SimulationViewMenuComponent.qml b/plugins/SimulationView/SimulationViewMenuComponent.qml index 98467a085d..b0aead8224 100644 --- a/plugins/SimulationView/SimulationViewMenuComponent.qml +++ b/plugins/SimulationView/SimulationViewMenuComponent.qml @@ -53,7 +53,7 @@ Cura.ExpandableComponent UM.Label { - id: SchemeTypeLabel + id: schemeTypeLabel text: layerTypeCombobox.currentText anchors.left: colorSchemeLabel.right anchors.leftMargin: UM.Theme.getSize("default_margin").width @@ -67,7 +67,7 @@ Cura.ExpandableComponent id: warningIcon anchors { - left: SchemeTypeLabel.right + left: schemeTypeLabel.right leftMargin: UM.Theme.getSize("narrow_margin").width verticalCenter: parent.verticalCenter } From 57fcd1e3c8cd84a9d102907290b1dc28ccc63f4c Mon Sep 17 00:00:00 2001 From: HellAholic Date: Wed, 19 Nov 2025 13:05:59 +0100 Subject: [PATCH 4/5] Fix extruder warning visibility logic Updated the warning icon visibility check to only consider extruders that exist in the current printer, preventing false warnings for non-existent extruders. --- plugins/SimulationView/SimulationViewMenuComponent.qml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/SimulationView/SimulationViewMenuComponent.qml b/plugins/SimulationView/SimulationViewMenuComponent.qml index b0aead8224..bc8e55a8ec 100644 --- a/plugins/SimulationView/SimulationViewMenuComponent.qml +++ b/plugins/SimulationView/SimulationViewMenuComponent.qml @@ -76,8 +76,9 @@ Cura.ExpandableComponent source: UM.Theme.getIcon("Warning") color: UM.Theme.getColor("warning") visible: { - // Check if any extruder is unchecked - for (var i = 0; i < viewSettings.extruder_opacities.length; i++) { + // Check if any extruder is unchecked, but only for extruders that exist in the current printer + var extruderCount = CuraApplication.getExtrudersModel().count; + for (var i = 0; i < extruderCount; i++) { if (viewSettings.extruder_opacities[i] <= 0.5 && viewSettings.extruder_opacities[i] !== undefined && viewSettings.extruder_opacities[i] !== "") { return true; } From 89a6708f196fcc2ac6d17e181af5fbdd91cfe8b1 Mon Sep 17 00:00:00 2001 From: HellAholic Date: Wed, 26 Nov 2025 09:01:50 +0100 Subject: [PATCH 5/5] Show warning only for enabled extruders Updated warning icon visibility logic to display warnings only for enabled extruders in the simulation view menu. This prevents warnings from appearing for extruders that are not active. --- .../SimulationView/SimulationViewMenuComponent.qml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/SimulationView/SimulationViewMenuComponent.qml b/plugins/SimulationView/SimulationViewMenuComponent.qml index bc8e55a8ec..dfb112275e 100644 --- a/plugins/SimulationView/SimulationViewMenuComponent.qml +++ b/plugins/SimulationView/SimulationViewMenuComponent.qml @@ -76,10 +76,11 @@ Cura.ExpandableComponent source: UM.Theme.getIcon("Warning") color: UM.Theme.getColor("warning") visible: { - // Check if any extruder is unchecked, but only for extruders that exist in the current printer - var extruderCount = CuraApplication.getExtrudersModel().count; - for (var i = 0; i < extruderCount; i++) { - if (viewSettings.extruder_opacities[i] <= 0.5 && viewSettings.extruder_opacities[i] !== undefined && viewSettings.extruder_opacities[i] !== "") { + // Check if any enabled extruder is unchecked + var extrudersModel = CuraApplication.getExtrudersModel(); + for (var i = 0; i < extrudersModel.count; i++) { + var extruder = extrudersModel.getItem(i); + if (extruder.enabled && viewSettings.extruder_opacities[i] <= 0.5 && viewSettings.extruder_opacities[i] !== undefined && viewSettings.extruder_opacities[i] !== "") { return true; } } @@ -253,7 +254,7 @@ Cura.ExpandableComponent height: UM.Theme.getSize("section_icon").height source: UM.Theme.getIcon("Warning") color: UM.Theme.getColor("warning") - visible: !extrudersModelCheckBox.checked + visible: model.enabled && !extrudersModelCheckBox.checked } } }