mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-09-14 07:03:12 +08:00
Inherit button now has the same behaviour as 2.1 again
CURA-1278
This commit is contained in:
parent
b452af5dbf
commit
77431b01a3
@ -24,7 +24,7 @@ Item {
|
|||||||
|
|
||||||
// Create properties to put property provider stuff in (bindings break in qt 5.5.1 otherwise)
|
// Create properties to put property provider stuff in (bindings break in qt 5.5.1 otherwise)
|
||||||
property var state: propertyProvider.properties.state
|
property var state: propertyProvider.properties.state
|
||||||
property var stackLevel: propertyProvider.stackLevel
|
property var stackLevel: propertyProvider.stackLevels[0]
|
||||||
|
|
||||||
signal contextMenuRequested()
|
signal contextMenuRequested()
|
||||||
signal showTooltip(string text);
|
signal showTooltip(string text);
|
||||||
@ -166,7 +166,15 @@ Item {
|
|||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
focus = true;
|
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");
|
backgroundColor: UM.Theme.getColor("setting_control");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user