Skip to content

Commit 422fa4b

Browse files
committed
fix(icon): Support non-qrc icons in a user location
1 parent c82b334 commit 422fa4b

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/core/Icon.qml

+7-3
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,14 @@ Item {
6363
} else if (icon.source.indexOf('icon://') === 0) {
6464
var name = icon.source.substring(7)
6565

66-
if (name)
67-
return "qrc:/icons/" + name + '.svg'
68-
else
66+
if (name) {
67+
if (Theme.iconsRoot.indexOf('qrc') != -1)
68+
return Theme.iconsRoot + '/' + name + '.svg'
69+
else
70+
return Theme.iconsRoot + '/' + name.replace('/', '_') + '.svg'
71+
} else {
6972
return ""
73+
}
7074
} else {
7175
return icon.source
7276
}

src/core/Theme.qml

+2
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ Object {
7979
light: false
8080
}
8181

82+
property string iconsRoot: "qrc:/icons"
83+
8284
/*!
8385
A utility method for changing the alpha on colors. Returns a new object, and does not modify
8486
the original color at all.

0 commit comments

Comments
 (0)