CURA-4354 fixed plugin injected tool icon path finding, example in PerObjectSettingsTool

This commit is contained in:
ChrisTerBeke 2017-09-22 16:15:38 +02:00
parent 045f1ce259
commit 11241642b3
3 changed files with 12 additions and 19 deletions

View file

@ -13,7 +13,7 @@ def getMetaData():
"tool": {
"name": i18n_catalog.i18nc("@label", "Per Model Settings"),
"description": i18n_catalog.i18nc("@info:tooltip", "Configure Per Model Settings"),
"icon": "setting_per_object",
"icon": "tool_icon.svg",
"tool_panel": "PerObjectSettingsPanel.qml",
"weight": 3
},

View file

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30">
<path d="M30 20L25.1 6.7 27.6 0H12.9l1.6 5H6.4l2.3 6H2.4l2.4 6.2L0 30h19.5l-1.7-4H26l-2.3-6H30zm-12.5 5l-2.8-7.5 2.4-6.5H9.6L7.7 6h14.7L20 12.4l2.9 7.6 2 5h-7.4z"/>
</svg>

After

Width:  |  Height:  |  Size: 240 B

View file

@ -34,28 +34,18 @@ Item
Button
{
text: model.name
iconSource:
{
var result = UM.Theme.getIcon(model.icon)
if(result == "")
{
return model.location + "/" + model.icon
}
return result
}
iconSource: (UM.Theme.getIcon(model.icon) != "") ? UM.Theme.getIcon(model.icon) : "file:///" + model.location + "/" + model.icon
checkable: true
checked: model.active
enabled: model.enabled && UM.Selection.hasSelection && UM.Controller.toolsEnabled
style: UM.Theme.styles.tool_button
checkable: true;
checked: model.active;
enabled: model.enabled && UM.Selection.hasSelection && UM.Controller.toolsEnabled;
style: UM.Theme.styles.tool_button;
onCheckedChanged:
{
if(checked)
{
onCheckedChanged: {
if (checked) {
base.activeY = y
}
}
//Workaround since using ToolButton"s onClicked would break the binding of the checked property, instead
//just catch the click so we do not trigger that behaviour.
MouseArea