mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-17 03:37:48 -06:00
Inheritance button now only shows if there is a function in the container stack at some point
CURA-1278
This commit is contained in:
parent
cf15f9e2a1
commit
fcd6f0959f
1 changed files with 18 additions and 3 deletions
|
@ -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;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue