diff --git a/resources/qml/Settings/SettingCheckBox.qml b/resources/qml/Settings/SettingCheckBox.qml index 0c7321d08a..8c0c58f371 100644 --- a/resources/qml/Settings/SettingCheckBox.qml +++ b/resources/qml/Settings/SettingCheckBox.qml @@ -29,7 +29,7 @@ SettingItem // 4: variant // 5: machine var value - if ((base.resolve != "None") && (stackLevel != 0) && (stackLevel != 1)) + if ((base.resolve !== undefined && base.resolve != "None") && (stackLevel != 0) && (stackLevel != 1)) { // We have a resolve function. Indicates that the setting is not settable per extruder and that // we have to choose between the resolved value (default) and the global value diff --git a/resources/qml/Settings/SettingComboBox.qml b/resources/qml/Settings/SettingComboBox.qml index 37df0bd9b9..6fcc1951a4 100644 --- a/resources/qml/Settings/SettingComboBox.qml +++ b/resources/qml/Settings/SettingComboBox.qml @@ -54,7 +54,7 @@ SettingItem { // FIXME this needs to go away once 'resolve' is combined with 'value' in our data model. var value = undefined - if ((base.resolve != "None") && (base.stackLevel != 0) && (base.stackLevel != 1)) + if ((base.resolve !== undefined && base.resolve != "None") && (base.stackLevel != 0) && (base.stackLevel != 1)) { // We have a resolve function. Indicates that the setting is not settable per extruder and that // we have to choose between the resolved value (default) and the global value diff --git a/resources/qml/Settings/SettingItem.qml b/resources/qml/Settings/SettingItem.qml index a95c888176..04b601f983 100644 --- a/resources/qml/Settings/SettingItem.qml +++ b/resources/qml/Settings/SettingItem.qml @@ -36,6 +36,20 @@ Item property var resolve: Cura.MachineManager.activeStackId !== Cura.MachineManager.activeMachineId ? propertyProvider.properties.resolve : "None" property var stackLevels: propertyProvider.stackLevels property var stackLevel: stackLevels[0] + // A list of stack levels that will trigger to show the revert button + property var showRevertStackLevels: [0] + property bool resetButtonVisible: { + var is_revert_stack_level = false; + for (var i in base.showRevertStackLevels) + { + if (base.stackLevel == i) + { + is_revert_stack_level = true + break + } + } + return is_revert_stack_level && base.showRevertButton + } signal focusReceived() signal setActiveFocusToNextSetting(bool forward) @@ -184,7 +198,7 @@ Item { id: revertButton - visible: base.stackLevel == 0 && base.showRevertButton + visible: base.resetButtonVisible height: parent.height width: height