Inherit button now has the same behaviour as 2.1 again

CURA-1278
This commit is contained in:
Jaime van Kessel 2016-06-08 11:02:04 +02:00
parent b452af5dbf
commit 77431b01a3

View file

@ -24,7 +24,7 @@ Item {
// Create properties to put property provider stuff in (bindings break in qt 5.5.1 otherwise)
property var state: propertyProvider.properties.state
property var stackLevel: propertyProvider.stackLevel
property var stackLevel: propertyProvider.stackLevels[0]
signal contextMenuRequested()
signal showTooltip(string text);
@ -166,7 +166,15 @@ Item {
onClicked: {
focus = true;
propertyProvider.removeFromContainer(base.stackLevel)
// Get the deepest entry of this setting that we can find. TODO: This is a bit naive, in some cases
// there might be multiple profiles saying something about the same setting. There is no strategy
// how to handle this as of yet.
var last_entry = propertyProvider.stackLevels.slice(-1)[0]
// Put that entry into the "top" instance container.
// 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))
}
backgroundColor: UM.Theme.getColor("setting_control");