From 3bc1cebfb3d67e08dc934c5090ad659e3166a79c Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Mon, 12 Jun 2017 15:04:55 +0200 Subject: Request the proper size, but then don't scale --- framework/qml/Icon.qml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'framework') diff --git a/framework/qml/Icon.qml b/framework/qml/Icon.qml index 947e69ef..fa2761fc 100644 --- a/framework/qml/Icon.qml +++ b/framework/qml/Icon.qml @@ -23,8 +23,8 @@ Item { property string iconName property url iconSource property alias status: image.status - property alias implicitWidth: image.implicitWidth - property alias implicitHeight: image.implicitHeight + implicitWidth: image.implicitWidth + implicitHeight: image.implicitHeight onIconNameChanged: setImageSource() @@ -37,11 +37,13 @@ Item { Image { id: image - anchors.fill: parent - sourceSize.width: width - sourceSize.height: height + anchors.centerIn: parent + width: image.implicitWidth + height: image.implicitWidth + sourceSize.width: root.width + sourceSize.height: root.height cache: true smooth: true - fillMode: Image.PreserveAspectFit + fillMode: Image.Pad } } -- cgit v1.2.3