on xenial help sign in
!= -1 → > 0
commit8f2114795c74cadc9fd882d520c4453c3b8b14cf authorAlbert Astals <albert.astals@canonical.com> dateFri 13 Jun 2014, 12:15 (12 years ago) parent849ae54
1 file changed+6−6
plugins/Dash/CardCreator.js+6−6
plugins/Dash/CardCreator.js+6−6
@@ -55,8 +55,8 @@ var kBackgroundLoaderCode = 'Loader {\n\
5555// %3 is used as image height
5656var kArtShapeHolderCode = 'Item { \n\
5757 id: artShapeHolder; \n\
58− height: root.fixedArtShapeSize.height != -1 ? root.fixedArtShapeSize.height : artShapeLoader.height; \n\
59− width: root.fixedArtShapeSize.width != -1 ? root.fixedArtShapeSize.width : artShapeLoader.width; \n\
58+ height: root.fixedArtShapeSize.height > 0 ? root.fixedArtShapeSize.height : artShapeLoader.height; \n\
59+ width: root.fixedArtShapeSize.width > 0 ? root.fixedArtShapeSize.width : artShapeLoader.width; \n\
6060 anchors { %1 } \n\
6161 Loader { \n\
6262 id: artShapeLoader; \n\
@@ -69,14 +69,14 @@ var kArtShapeHolderCode = 'Item { \n\
6969 objectName: "artShape"; \n\
7070 radius: "medium"; \n\
7171 visible: image.status == Image.Ready; \n\
72− readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height != -1 && root.fixedArtShapeSize.width != -1) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1; \n\
73− readonly property real aspect: fixedArtShapeSizeAspect != -1 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1; \n\
72+ readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1; \n\
73+ readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1; \n\
7474 readonly property bool aspectSmallerThanImageAspect: aspect < image.aspect; \n\
7575 Component.onCompleted: { updateWidthHeightBindings(); if (artShapeBorderSource !== undefined) borderSource = artShapeBorderSource; } \n\
7676 onAspectSmallerThanImageAspectChanged: updateWidthHeightBindings(); \n\
7777 Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); } \n\
7878 function updateWidthHeightBindings() { \n\
79− if (root.fixedArtShapeSize.height != -1 && root.fixedArtShapeSize.width != -1) { \n\
79+ if (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) { \n\
8080 width = root.fixedArtShapeSize.width; \n\
8181 height = root.fixedArtShapeSize.height; \n\
8282 } else if (aspectSmallerThanImageAspect) { \n\
@@ -113,7 +113,7 @@ var kOverlayLoaderCode = 'Loader { \n\
113113 visible: showHeader && status == Loader.Ready; \n\
114114 sourceComponent: ShaderEffect { \n\
115115 id: overlay; \n\
116− height: fixedHeaderHeight != -1 ? fixedHeaderHeight : headerHeight; \n\
116+ height: fixedHeaderHeight > 0 ? fixedHeaderHeight : headerHeight; \n\
117117 opacity: 0.6; \n\
118118 property var source: ShaderEffectSource { \n\
119119 id: shaderSource; \n\