From cf15f9e2a11a593648bd4217408f6b64934858f6 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 8 Jun 2016 15:31:28 +0200 Subject: [PATCH] Added handling of special case when only user & definition were set CURA-1278 --- resources/qml/Settings/SettingItem.qml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/resources/qml/Settings/SettingItem.qml b/resources/qml/Settings/SettingItem.qml index 2f1a74dba6..9ed75bdecf 100644 --- a/resources/qml/Settings/SettingItem.qml +++ b/resources/qml/Settings/SettingItem.qml @@ -175,8 +175,17 @@ Item { // This ensures that the value in any of the deeper containers need not be removed, which is // needed for the reset button (which deletes the top value) to correctly go back to profile // defaults. - propertyProvider.setPropertyValue("value", propertyProvider.getPropertyValue("value", last_entry)) - propertyProvider.setPropertyValue("state", "InstanceState.Calculated") + if(last_entry == 4 && base.stackLevel == 0) + { + // Special case of the inherit reset. If only the definition (4th container) and the first + // entry (user container) are set, we can simply remove the container. + propertyProvider.removeFromContainer(0) + } + else + { + propertyProvider.setPropertyValue("value", propertyProvider.getPropertyValue("value", last_entry)) + propertyProvider.setPropertyValue("state", "InstanceState.Calculated") + } } backgroundColor: UM.Theme.getColor("setting_control");