don't redefine iconSource

This commit is contained in:
Marco Martin 2014-07-24 17:38:13 +02:00
parent 9365123152
commit a39c8898b3
2 changed files with 7 additions and 3 deletions

View File

@ -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
*/

View File

@ -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