on xenial help sign in
Fix warnings
7c045b5Andrea Cimitan
plugins/Dash/CardCreator.js+3−3
@@ -70,10 +70,9 @@ var kArtShapeHolderCode = 'Item { \n\
70 radius: "medium"; \n\
70 radius: "medium"; \n\
71 readonly property real aspect: components !== undefined ? components["art"]["aspect-ratio"] : 1; \n\
71 readonly property real aspect: components !== undefined ? components["art"]["aspect-ratio"] : 1; \n\
72 readonly property bool aspectSmallerThanImageAspect: aspect < image.aspect; \n\
72 readonly property bool aspectSmallerThanImageAspect: aspect < image.aspect; \n\
73− Component.onCompleted: updateWidthHeightBindings(); \n\
73+ Component.onCompleted: { updateWidthHeightBindings(); if (artShapeBorderSource !== undefined) borderSource = artShapeBorderSource; } \n\
74 onAspectSmallerThanImageAspectChanged: updateWidthHeightBindings(); \n\
74 onAspectSmallerThanImageAspectChanged: updateWidthHeightBindings(); \n\
75 visible: image.status == Image.Ready; \n\
75 visible: image.status == Image.Ready; \n\
76− borderSource: artShapeBorderSource; \n\
77 function updateWidthHeightBindings() { \n\
76 function updateWidthHeightBindings() { \n\
78 if (aspectSmallerThanImageAspect) { \n\
77 if (aspectSmallerThanImageAspect) { \n\
79 width = Qt.binding(function() { return !visible ? 0 : image.width }); \n\
78 width = Qt.binding(function() { return !visible ? 0 : image.width }); \n\
@@ -281,7 +280,7 @@ function cardString(template, components) {
281 property var template; \n\
280 property var template; \n\
282 property var components; \n\
281 property var components; \n\
283 property var cardData; \n\
282 property var cardData; \n\
284− property var artShapeBorderSource; \n\
283+ property var artShapeBorderSource: undefined; \n\
285 property real fontScale: 1.0; \n\
284 property real fontScale: 1.0; \n\
286 property int headerAlignment: Text.AlignLeft; \n\
285 property int headerAlignment: Text.AlignLeft; \n\
287 property int fixedHeaderHeight: -1; \n\
286 property int fixedHeaderHeight: -1; \n\
@@ -307,6 +306,7 @@ function cardString(template, components) {
307 }
306 }
308
307
309 if (hasArt) {
308 if (hasArt) {
309+ code += 'onArtShapeBorderSourceChanged: { if (artShapeBorderSource !== undefined && artShapeLoader.item) artShapeLoader.item.borderSource = artShapeBorderSource; } \n';
310 code += 'readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);\n';
310 code += 'readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);\n';
311
311
312 var widthCode, heightCode;
312 var widthCode, heightCode;
qml/Dash/CardCarousel.qml+1−1
@@ -34,7 +34,7 @@ DashRenderer {
34 Carousel {
34 Carousel {
35 id: carousel
35 id: carousel
36 anchors.fill: parent
36 anchors.fill: parent
37− tileAspectRatio: cardCarousel.components && cardCarousel.components["art"]["aspect-ratio"] || 1.0
37+ tileAspectRatio: cardTool.components && cardTool.components["art"]["aspect-ratio"] || 1.0
38 // FIXME we need to "reverse" the carousel to make the selected item the size
38 // FIXME we need to "reverse" the carousel to make the selected item the size
39 // and push others back.
39 // and push others back.
40 minimumTileWidth: cardTool.cardWidth / selectedItemScaleFactor
40 minimumTileWidth: cardTool.cardWidth / selectedItemScaleFactor
tests/plugins/Dash/cardcreator/1.res+3−3
@@ -3,7 +3,7 @@ AbstractButton {
3 property var template;
3 property var template;
4 property var components;
4 property var components;
5 property var cardData;
5 property var cardData;
6− property var artShapeBorderSource;
6+ property var artShapeBorderSource: undefined;
7 property real fontScale: 1.0;
7 property real fontScale: 1.0;
8 property int headerAlignment: Text.AlignLeft;
8 property int headerAlignment: Text.AlignLeft;
9 property int fixedHeaderHeight: -1;
9 property int fixedHeaderHeight: -1;
@@ -12,6 +12,7 @@ AbstractButton {
12 property bool asynchronous: true;
12 property bool asynchronous: true;
13 property bool showHeader: true;
13 property bool showHeader: true;
14 implicitWidth: childrenRect.width;
14 implicitWidth: childrenRect.width;
15+onArtShapeBorderSourceChanged: { if (artShapeBorderSource !== undefined && artShapeLoader.item) artShapeLoader.item.borderSource = artShapeBorderSource; }
15readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
16readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
16Item {
17Item {
17 id: artShapeHolder;
18 id: artShapeHolder;
@@ -30,10 +31,9 @@ Item {
30 radius: "medium";
31 radius: "medium";
31 readonly property real aspect: components !== undefined ? components["art"]["aspect-ratio"] : 1;
32 readonly property real aspect: components !== undefined ? components["art"]["aspect-ratio"] : 1;
32 readonly property bool aspectSmallerThanImageAspect: aspect < image.aspect;
33 readonly property bool aspectSmallerThanImageAspect: aspect < image.aspect;
33− Component.onCompleted: updateWidthHeightBindings();
34+ Component.onCompleted: { updateWidthHeightBindings(); if (artShapeBorderSource !== undefined) borderSource = artShapeBorderSource; }
34 onAspectSmallerThanImageAspectChanged: updateWidthHeightBindings();
35 onAspectSmallerThanImageAspectChanged: updateWidthHeightBindings();
35 visible: image.status == Image.Ready;
36 visible: image.status == Image.Ready;
36− borderSource: artShapeBorderSource;
37 function updateWidthHeightBindings() {
37 function updateWidthHeightBindings() {
38 if (aspectSmallerThanImageAspect) {
38 if (aspectSmallerThanImageAspect) {
39 width = Qt.binding(function() { return !visible ? 0 : image.width });
39 width = Qt.binding(function() { return !visible ? 0 : image.width });
tests/plugins/Dash/cardcreator/2.res+1−1
@@ -3,7 +3,7 @@ AbstractButton {
3 property var template;
3 property var template;
4 property var components;
4 property var components;
5 property var cardData;
5 property var cardData;
6− property var artShapeBorderSource;
6+ property var artShapeBorderSource: undefined;
7 property real fontScale: 1.0;
7 property real fontScale: 1.0;
8 property int headerAlignment: Text.AlignLeft;
8 property int headerAlignment: Text.AlignLeft;
9 property int fixedHeaderHeight: -1;
9 property int fixedHeaderHeight: -1;
tests/plugins/Dash/cardcreator/3.res+3−3
@@ -3,7 +3,7 @@ AbstractButton {
3 property var template;
3 property var template;
4 property var components;
4 property var components;
5 property var cardData;
5 property var cardData;
6− property var artShapeBorderSource;
6+ property var artShapeBorderSource: undefined;
7 property real fontScale: 1.0;
7 property real fontScale: 1.0;
8 property int headerAlignment: Text.AlignLeft;
8 property int headerAlignment: Text.AlignLeft;
9 property int fixedHeaderHeight: -1;
9 property int fixedHeaderHeight: -1;
@@ -12,6 +12,7 @@ AbstractButton {
12 property bool asynchronous: true;
12 property bool asynchronous: true;
13 property bool showHeader: true;
13 property bool showHeader: true;
14 implicitWidth: childrenRect.width;
14 implicitWidth: childrenRect.width;
15+onArtShapeBorderSourceChanged: { if (artShapeBorderSource !== undefined && artShapeLoader.item) artShapeLoader.item.borderSource = artShapeBorderSource; }
15readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
16readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
16Item {
17Item {
17 id: artShapeHolder;
18 id: artShapeHolder;
@@ -30,10 +31,9 @@ Item {
30 radius: "medium";
31 radius: "medium";
31 readonly property real aspect: components !== undefined ? components["art"]["aspect-ratio"] : 1;
32 readonly property real aspect: components !== undefined ? components["art"]["aspect-ratio"] : 1;
32 readonly property bool aspectSmallerThanImageAspect: aspect < image.aspect;
33 readonly property bool aspectSmallerThanImageAspect: aspect < image.aspect;
33− Component.onCompleted: updateWidthHeightBindings();
34+ Component.onCompleted: { updateWidthHeightBindings(); if (artShapeBorderSource !== undefined) borderSource = artShapeBorderSource; }
34 onAspectSmallerThanImageAspectChanged: updateWidthHeightBindings();
35 onAspectSmallerThanImageAspectChanged: updateWidthHeightBindings();
35 visible: image.status == Image.Ready;
36 visible: image.status == Image.Ready;
36− borderSource: artShapeBorderSource;
37 function updateWidthHeightBindings() {
37 function updateWidthHeightBindings() {
38 if (aspectSmallerThanImageAspect) {
38 if (aspectSmallerThanImageAspect) {
39 width = Qt.binding(function() { return !visible ? 0 : image.width });
39 width = Qt.binding(function() { return !visible ? 0 : image.width });
tests/plugins/Dash/cardcreator/4.res+1−1
@@ -3,7 +3,7 @@ AbstractButton {
3 property var template;
3 property var template;
4 property var components;
4 property var components;
5 property var cardData;
5 property var cardData;
6− property var artShapeBorderSource;
6+ property var artShapeBorderSource: undefined;
7 property real fontScale: 1.0;
7 property real fontScale: 1.0;
8 property int headerAlignment: Text.AlignLeft;
8 property int headerAlignment: Text.AlignLeft;
9 property int fixedHeaderHeight: -1;
9 property int fixedHeaderHeight: -1;
tests/plugins/Dash/cardcreator/5.res+3−3
@@ -3,7 +3,7 @@ AbstractButton {
3 property var template;
3 property var template;
4 property var components;
4 property var components;
5 property var cardData;
5 property var cardData;
6− property var artShapeBorderSource;
6+ property var artShapeBorderSource: undefined;
7 property real fontScale: 1.0;
7 property real fontScale: 1.0;
8 property int headerAlignment: Text.AlignLeft;
8 property int headerAlignment: Text.AlignLeft;
9 property int fixedHeaderHeight: -1;
9 property int fixedHeaderHeight: -1;
@@ -12,6 +12,7 @@ AbstractButton {
12 property bool asynchronous: true;
12 property bool asynchronous: true;
13 property bool showHeader: true;
13 property bool showHeader: true;
14 implicitWidth: childrenRect.width;
14 implicitWidth: childrenRect.width;
15+onArtShapeBorderSourceChanged: { if (artShapeBorderSource !== undefined && artShapeLoader.item) artShapeLoader.item.borderSource = artShapeBorderSource; }
15readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
16readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
16Item {
17Item {
17 id: artShapeHolder;
18 id: artShapeHolder;
@@ -30,10 +31,9 @@ Item {
30 radius: "medium";
31 radius: "medium";
31 readonly property real aspect: components !== undefined ? components["art"]["aspect-ratio"] : 1;
32 readonly property real aspect: components !== undefined ? components["art"]["aspect-ratio"] : 1;
32 readonly property bool aspectSmallerThanImageAspect: aspect < image.aspect;
33 readonly property bool aspectSmallerThanImageAspect: aspect < image.aspect;
33− Component.onCompleted: updateWidthHeightBindings();
34+ Component.onCompleted: { updateWidthHeightBindings(); if (artShapeBorderSource !== undefined) borderSource = artShapeBorderSource; }
34 onAspectSmallerThanImageAspectChanged: updateWidthHeightBindings();
35 onAspectSmallerThanImageAspectChanged: updateWidthHeightBindings();
35 visible: image.status == Image.Ready;
36 visible: image.status == Image.Ready;
36− borderSource: artShapeBorderSource;
37 function updateWidthHeightBindings() {
37 function updateWidthHeightBindings() {
38 if (aspectSmallerThanImageAspect) {
38 if (aspectSmallerThanImageAspect) {
39 width = Qt.binding(function() { return !visible ? 0 : image.width });
39 width = Qt.binding(function() { return !visible ? 0 : image.width });