From a39c8898b32eb4a628d6312e917d14e1bf843c2a Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 24 Jul 2014 17:38:13 +0200 Subject: [PATCH] don't redefine iconSource --- src/declarativeimports/plasmacomponents/qml/Button.qml | 2 -- .../plasmacomponents/qml/styles/ButtonStyle.qml | 8 +++++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/declarativeimports/plasmacomponents/qml/Button.qml b/src/declarativeimports/plasmacomponents/qml/Button.qml index cc430d292..607778cd0 100644 --- a/src/declarativeimports/plasmacomponents/qml/Button.qml +++ b/src/declarativeimports/plasmacomponents/qml/Button.qml @@ -51,8 +51,6 @@ QtControls.Button { */ property font font: theme.defaultFont - property string iconSource: "" - /** * Smallest width this button can be to show all the contents */ diff --git a/src/declarativeimports/plasmacomponents/qml/styles/ButtonStyle.qml b/src/declarativeimports/plasmacomponents/qml/styles/ButtonStyle.qml index d6bf144aa..419598a3d 100644 --- a/src/declarativeimports/plasmacomponents/qml/styles/ButtonStyle.qml +++ b/src/declarativeimports/plasmacomponents/qml/styles/ButtonStyle.qml @@ -49,7 +49,13 @@ QtQuickControlStyle.ButtonStyle { PlasmaCore.IconItem { id: icon - source: control.iconSource + //control.iconSource is an url: you pass a freedesktop icon, + //and it inteprets it as an url in the local qml file filesystem path + //in order to work also with upstream controls, grossly parse the url + source: { + var url = String(control.iconSource); + return url.substring(url.lastIndexOf("/") + 1); + } anchors.verticalCenter: parent.verticalCenter width: valid ? parent.height: 0 visible: valid