mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-07 05:53:59 -06:00
Expand logic for showing the inherit button in SettingItem
Hide it if the revert button is visible and make the overrides check limit_to_extruder in addition to the active stack. Contributes to CURA-2752
This commit is contained in:
parent
bdaa4a5a6d
commit
8ce81fec9f
1 changed files with 18 additions and 1 deletions
|
@ -194,10 +194,27 @@ Item {
|
|||
// Inherit button needs to be visible if;
|
||||
// - User made changes that override any loaded settings
|
||||
// - This setting item uses inherit button at all
|
||||
// - The revert button is not visible.
|
||||
// - The type of the value of any deeper container is an "object" (eg; is a function)
|
||||
visible:
|
||||
{
|
||||
return showInheritButton && Cura.SettingInheritanceManager.settingsWithInheritanceWarning.indexOf(definition.key) >= 0;
|
||||
if(!base.showInheritButton)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(revertButton.visible)
|
||||
{
|
||||
// The revert button already indicates there is a custom value for this setting, making this button superfluous.
|
||||
return false;
|
||||
}
|
||||
|
||||
if(globalPropertyProvider.properties.limit_to_extruder == null || globalPropertyProvider.properties.limit_to_extruder == -1)
|
||||
{
|
||||
return Cura.SettingInheritanceManager.settingsWithInheritanceWarning.indexOf(definition.key) >= 0;
|
||||
}
|
||||
|
||||
return Cura.SettingInheritanceManager.getOverridesForExtruder(definition.key, globalPropertyProvider.properties.limit_to_extruder).indexOf(definition.key) >= 0;
|
||||
}
|
||||
|
||||
height: parent.height;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue