mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-23 14:44:13 -06:00
Display affects/affected by in the tooltip again
Contributes to CURA-1278
This commit is contained in:
parent
581b9ce11f
commit
d616a72bb1
1 changed files with 31 additions and 1 deletions
|
@ -50,7 +50,37 @@ Item {
|
||||||
interval: 500;
|
interval: 500;
|
||||||
repeat: false;
|
repeat: false;
|
||||||
|
|
||||||
onTriggered: base.showTooltip(definition.description);
|
onTriggered:
|
||||||
|
{
|
||||||
|
var affects = settingDefinitionsModel.getRequiredBy(definition.key, "value")
|
||||||
|
var affected_by = settingDefinitionsModel.getRequires(definition.key, "value")
|
||||||
|
|
||||||
|
var affected_by_list = ""
|
||||||
|
for(var i in affected_by)
|
||||||
|
{
|
||||||
|
affected_by_list += "<li>%1</li>\n".arg(affected_by[i].label)
|
||||||
|
}
|
||||||
|
|
||||||
|
var affects_list = ""
|
||||||
|
for(var i in affects)
|
||||||
|
{
|
||||||
|
affects_list += "<li>%1</li>\n".arg(affects[i].label)
|
||||||
|
}
|
||||||
|
|
||||||
|
var tooltip = "<b>%1</b><br/>\n<p>%2</p>".arg(definition.label).arg(definition.description)
|
||||||
|
|
||||||
|
if(affects_list != "")
|
||||||
|
{
|
||||||
|
tooltip += "<br/><b>%1</b><br/>\n<ul>\n%2</ul>".arg(catalog.i18nc("@label", "Affects")).arg(affects_list)
|
||||||
|
}
|
||||||
|
|
||||||
|
if(affected_by_list != "")
|
||||||
|
{
|
||||||
|
tooltip += "<br/><b>%1</b><br/>\n<ul>\n%2</ul>".arg(catalog.i18nc("@label", "Affected By")).arg(affected_by_list)
|
||||||
|
}
|
||||||
|
|
||||||
|
base.showTooltip(tooltip);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Label
|
Label
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue