@@ -76,17 +76,17 @@ AbstractButton {
76 visible: cardData && cardData["art"] || false
76 visible: cardData && cardData["art"] || false
78 readonly property real aspect: components !== undefined ? components["art"]["aspect-ratio"] : 1
78 readonly property real aspect: components !== undefined ? components["art"]["aspect-ratio"] : 1
79− readonly property bool useImageWidthForWidth: image.fillMode === Image.PreserveAspectCrop || aspect < image.aspect
79+ readonly property bool aspectSmallerThanImageAspect: aspect < image.aspect
81 Component.onCompleted: updateWidthHeightBindings();
81 Component.onCompleted: updateWidthHeightBindings();
82− onUseImageWidthForWidthChanged: updateWidthHeightBindings();
82+ onAspectSmallerThanImageAspectChanged: updateWidthHeightBindings();
84 function updateWidthHeightBindings() {
84 function updateWidthHeightBindings() {
85− if (useImageWidthForWidth) {
85+ if (aspectSmallerThanImageAspect) {
86− width = Qt.binding(function() { return visible ? image.width : 0 });
86+ width = Qt.binding(function() { return !visible ? 0 : image.width });
87− height = Qt.binding(function() { return visible ? width / image.aspect : 0 });
87+ height = Qt.binding(function() { return !visible ? 0 : image.fillMode === Image.PreserveAspectCrop ? image.height : width / image.aspect });
89− width = Qt.binding(function() { return visible ? height * image.aspect : 0 });
89+ width = Qt.binding(function() { return !visible ? 0 : image.fillMode === Image.PreserveAspectCrop ? image.width : height * image.aspect });
90 height = Qt.binding(function() { return visible ? image.height : 0 });
90 height = Qt.binding(function() { return visible ? image.height : 0 });