From 422fa4b9e9975f49e0d48039656ce8941d85af1b Mon Sep 17 00:00:00 2001 From: Michael Spencer Date: Wed, 15 Jun 2016 21:33:52 -0500 Subject: [PATCH] fix(icon): Support non-qrc icons in a user location --- src/core/Icon.qml | 10 +++++++--- src/core/Theme.qml | 2 ++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/core/Icon.qml b/src/core/Icon.qml index d73a6705..1a54d1ff 100644 --- a/src/core/Icon.qml +++ b/src/core/Icon.qml @@ -63,10 +63,14 @@ Item { } else if (icon.source.indexOf('icon://') === 0) { var name = icon.source.substring(7) - if (name) - return "qrc:/icons/" + name + '.svg' - else + if (name) { + if (Theme.iconsRoot.indexOf('qrc') != -1) + return Theme.iconsRoot + '/' + name + '.svg' + else + return Theme.iconsRoot + '/' + name.replace('/', '_') + '.svg' + } else { return "" + } } else { return icon.source } diff --git a/src/core/Theme.qml b/src/core/Theme.qml index 6f9b508c..c8b2e959 100644 --- a/src/core/Theme.qml +++ b/src/core/Theme.qml @@ -79,6 +79,8 @@ Object { light: false } + property string iconsRoot: "qrc:/icons" + /*! A utility method for changing the alpha on colors. Returns a new object, and does not modify the original color at all.