tablet-ui: button icon images now work with http urls.

This commit is contained in:
Anthony J. Thibault 2017-01-31 16:53:25 -08:00
parent 2fc6b4b0af
commit 8f362861eb

View file

@ -75,6 +75,14 @@ Item {
source: buttonOutline
}
function urlHelper(src) {
if (src.match(/\bhttp/)) {
return src;
} else {
return "../../../" + src;
}
}
Image {
id: icon
width: 50
@ -84,7 +92,7 @@ Item {
anchors.bottomMargin: 5
anchors.horizontalCenter: parent.horizontalCenter
fillMode: Image.Stretch
source: "../../../" + tabletButton.icon
source: tabletButton.urlHelper(tabletButton.icon)
}
ColorOverlay {
@ -185,7 +193,7 @@ Item {
PropertyChanges {
target: icon
source: "../../../" + tabletButton.activeIcon
source: tabletButton.urlHelper(tabletButton.activeIcon)
}
},
State {