Inheritance button now only shows if there is a function in the container stack at some point

CURA-1278
This commit is contained in:
Jaime van Kessel 2016-06-08 17:47:23 +02:00
parent cf15f9e2a1
commit fcd6f0959f

View file

@ -158,9 +158,24 @@ Item {
{ {
// This button shows when the setting has an inherited function, but is overriden by profile. // This button shows when the setting has an inherited function, but is overriden by profile.
id: inheritButton; id: inheritButton;
// Inherit button needs to be visible if;
//visible: has_profile_value && base.has_inherit_function && base.is_enabled // - User made changes that override any loaded settings
visible: base.state == "InstanceState.User" && base.showInheritButton // - This setting item uses inherit button at all
// - The type of the value of any deeper container is an "object" (eg; is a function)
visible:
{
var state = base.state == "InstanceState.User";
var has_setting_function = false;
for (var i = 1; i < base.stackLevels.length; i++)
{
has_setting_function = typeof(propertyProvider.getPropertyValue("value", base.stackLevels[i])) == "object";
if(has_setting_function)
{
break;
}
}
return state && base.showInheritButton && has_setting_function
}
height: parent.height; height: parent.height;
width: height; width: height;