Merge lp:~aacid/unity8/clickScopeForceArtShapeSize into lp:unity8
- clickScopeForceArtShapeSize
- Merge into trunk
Status: | Superseded |
---|---|
Proposed branch: | lp:~aacid/unity8/clickScopeForceArtShapeSize |
Merge into: | lp:unity8 |
Diff against target: |
371 lines (+37/-63) 18 files modified
plugins/Dash/CardCreator.js (+2/-8) qml/Dash/CardTool.qml (+1/-1) qml/Dash/GenericScopeView.qml (+4/-0) tests/plugins/Dash/cardcreator/1.res (+4/-10) tests/plugins/Dash/cardcreator/1.tst (+1/-1) tests/plugins/Dash/cardcreator/2.tst (+1/-1) tests/plugins/Dash/cardcreator/3.res (+4/-10) tests/plugins/Dash/cardcreator/3.tst (+1/-1) tests/plugins/Dash/cardcreator/4.tst (+1/-1) tests/plugins/Dash/cardcreator/5.res (+6/-12) tests/plugins/Dash/cardcreator/5.tst (+1/-1) tests/plugins/Dash/cardcreator/6.res (+2/-8) tests/plugins/Dash/cardcreator/6.tst (+1/-1) tests/plugins/Dash/cardcreator/7.res (+1/-1) tests/plugins/Dash/cardcreator/7.tst (+1/-1) tests/qmltests/Dash/CardHelpers.js (+1/-2) tests/qmltests/Dash/tst_Card.qml (+3/-3) tests/qmltests/Dash/tst_GenericScopeView.qml (+2/-1) |
To merge this branch: | bzr merge lp:~aacid/unity8/clickScopeForceArtShapeSize |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Needs Fixing | |
Unity Team | Pending | ||
Review via email: mp+228505@code.launchpad.net |
This proposal has been superseded by a proposal from 2014-08-05.
Commit message
Hardcode art shape size for click scope local and predefined categories
While at it, drop the fillmode of cards
Description of the change
* Are there any related MPs required for this MP to build/function as expected?
https:/
* Did you perform an exploratory manual test run of your code change and any related functionality?
Yes
* Did you make sure that your branch does not contain spurious tags?
Yes
* If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A
* If you changed the UI, has there been a design review?
N/A
- 1088. By Albert Astals Cid
-
Fix creator expected code
- 1089. By Albert Astals Cid
-
We don't support fill-mode anymore
- 1090. By Albert Astals Cid
-
spacing
PS Jenkins bot (ps-jenkins) wrote : | # |
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1090
http://
Executed test runs:
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1090
http://
Executed test runs:
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 1091. By Albert Astals Cid
-
More stable tests
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:1091
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 1092. By Albert Astals Cid
-
Merge
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1092
http://
Executed test runs:
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 1093. By Albert Astals Cid
-
Merge
- 1094. By Albert Astals Cid
-
Merge again
- 1095. By Albert Astals Cid
-
Pass the test
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1095
http://
Executed test runs:
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 1096. By Albert Astals Cid
-
Merge
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1096
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 1097. By Albert Astals Cid
-
The comment was upsetting people
Unmerged revisions
- 1097. By Albert Astals Cid
-
The comment was upsetting people
Preview Diff
1 | === modified file 'plugins/Dash/CardCreator.js' | |||
2 | --- plugins/Dash/CardCreator.js 2014-07-28 09:28:50 +0000 | |||
3 | +++ plugins/Dash/CardCreator.js 2014-08-05 18:01:59 +0000 | |||
4 | @@ -71,19 +71,14 @@ | |||
5 | 71 | visible: image.status == Image.Ready; \n\ | 71 | visible: image.status == Image.Ready; \n\ |
6 | 72 | readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1; \n\ | 72 | readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1; \n\ |
7 | 73 | readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1; \n\ | 73 | readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1; \n\ |
8 | 74 | readonly property bool aspectSmallerThanImageAspect: aspect < image.aspect; \n\ | ||
9 | 75 | Component.onCompleted: { updateWidthHeightBindings(); if (artShapeBorderSource !== undefined) borderSource = artShapeBorderSource; } \n\ | 74 | Component.onCompleted: { updateWidthHeightBindings(); if (artShapeBorderSource !== undefined) borderSource = artShapeBorderSource; } \n\ |
10 | 76 | onAspectSmallerThanImageAspectChanged: updateWidthHeightBindings(); \n\ | ||
11 | 77 | Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); } \n\ | 75 | Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); } \n\ |
12 | 78 | function updateWidthHeightBindings() { \n\ | 76 | function updateWidthHeightBindings() { \n\ |
13 | 79 | if (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) { \n\ | 77 | if (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) { \n\ |
14 | 80 | width = root.fixedArtShapeSize.width; \n\ | 78 | width = root.fixedArtShapeSize.width; \n\ |
15 | 81 | height = root.fixedArtShapeSize.height; \n\ | 79 | height = root.fixedArtShapeSize.height; \n\ |
17 | 82 | } else if (aspectSmallerThanImageAspect) { \n\ | 80 | } else { \n\ |
18 | 83 | width = Qt.binding(function() { return !visible ? 0 : image.width }); \n\ | 81 | width = Qt.binding(function() { return !visible ? 0 : image.width }); \n\ |
19 | 84 | height = Qt.binding(function() { return !visible ? 0 : image.fillMode === Image.PreserveAspectCrop ? image.height : width / image.aspect }); \n\ | ||
20 | 85 | } else { \n\ | ||
21 | 86 | width = Qt.binding(function() { return !visible ? 0 : image.fillMode === Image.PreserveAspectCrop ? image.width : height * image.aspect }); \n\ | ||
22 | 87 | height = Qt.binding(function() { return !visible ? 0 : image.height }); \n\ | 82 | height = Qt.binding(function() { return !visible ? 0 : image.height }); \n\ |
23 | 88 | } \n\ | 83 | } \n\ |
24 | 89 | } \n\ | 84 | } \n\ |
25 | @@ -92,8 +87,7 @@ | |||
26 | 92 | source: cardData && cardData["art"] || ""; \n\ | 87 | source: cardData && cardData["art"] || ""; \n\ |
27 | 93 | cache: true; \n\ | 88 | cache: true; \n\ |
28 | 94 | asynchronous: root.asynchronous; \n\ | 89 | asynchronous: root.asynchronous; \n\ |
31 | 95 | fillMode: components && components["art"]["fill-mode"] === "fit" ? Image.PreserveAspectFit: Image.PreserveAspectCrop; \n\ | 90 | fillMode: Image.PreserveAspectCrop; \n\ |
30 | 96 | readonly property real aspect: implicitWidth / implicitHeight; \n\ | ||
32 | 97 | width: %2; \n\ | 91 | width: %2; \n\ |
33 | 98 | height: %3; \n\ | 92 | height: %3; \n\ |
34 | 99 | } \n\ | 93 | } \n\ |
35 | 100 | 94 | ||
36 | === modified file 'qml/Dash/CardTool.qml' | |||
37 | --- qml/Dash/CardTool.qml 2014-07-28 11:59:50 +0000 | |||
38 | +++ qml/Dash/CardTool.qml 2014-08-05 18:01:59 +0000 | |||
39 | @@ -126,7 +126,7 @@ | |||
40 | 126 | type:real \brief Height of the card's header. | 126 | type:real \brief Height of the card's header. |
41 | 127 | */ | 127 | */ |
42 | 128 | readonly property int headerHeight: cardLoader.item ? cardLoader.item.headerHeight : 0 | 128 | readonly property int headerHeight: cardLoader.item ? cardLoader.item.headerHeight : 0 |
44 | 129 | readonly property size artShapeSize: cardLoader.item ? cardLoader.item.artShapeSize : 0 | 129 | property size artShapeSize: cardLoader.item ? cardLoader.item.artShapeSize : 0 |
45 | 130 | 130 | ||
46 | 131 | /*! | 131 | /*! |
47 | 132 | \brief Desired alignment of header components. | 132 | \brief Desired alignment of header components. |
48 | 133 | 133 | ||
49 | === modified file 'qml/Dash/GenericScopeView.qml' | |||
50 | --- qml/Dash/GenericScopeView.qml 2014-07-29 11:35:10 +0000 | |||
51 | +++ qml/Dash/GenericScopeView.qml 2014-08-05 18:01:59 +0000 | |||
52 | @@ -211,6 +211,10 @@ | |||
53 | 211 | baseItem.expand(shouldExpand, false /*animate*/); | 211 | baseItem.expand(shouldExpand, false /*animate*/); |
54 | 212 | } | 212 | } |
55 | 213 | updateDelegateCreationRange(); | 213 | updateDelegateCreationRange(); |
56 | 214 | if (scope && scope.id === "clickscope" && (categoryId === "predefined" || categoryId === "local")) { | ||
57 | 215 | // Yeah, hackish :/ | ||
58 | 216 | cardTool.artShapeSize = Qt.size(units.gu(8), units.gu(7.5)); | ||
59 | 217 | } | ||
60 | 214 | item.cardTool = cardTool; | 218 | item.cardTool = cardTool; |
61 | 215 | } | 219 | } |
62 | 216 | 220 | ||
63 | 217 | 221 | ||
64 | === modified file 'tests/plugins/Dash/cardcreator/1.res' | |||
65 | --- tests/plugins/Dash/cardcreator/1.res 2014-07-24 10:03:58 +0000 | |||
66 | +++ tests/plugins/Dash/cardcreator/1.res 2014-08-05 18:01:59 +0000 | |||
67 | @@ -33,20 +33,15 @@ | |||
68 | 33 | visible: image.status == Image.Ready; | 33 | visible: image.status == Image.Ready; |
69 | 34 | readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1; | 34 | readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1; |
70 | 35 | readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1; | 35 | readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1; |
74 | 36 | readonly property bool aspectSmallerThanImageAspect: aspect < image.aspect; | 36 | Component.onCompleted: { updateWidthHeightBindings(); if (artShapeBorderSource !== undefined) borderSource = artShapeBorderSource; } |
72 | 37 | Component.onCompleted: { updateWidthHeightBindings(); if (artShapeBorderSource !== undefined) borderSource = artShapeBorderSource; } | ||
73 | 38 | onAspectSmallerThanImageAspectChanged: updateWidthHeightBindings(); | ||
75 | 39 | Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); } | 37 | Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); } |
76 | 40 | function updateWidthHeightBindings() { | 38 | function updateWidthHeightBindings() { |
77 | 41 | if (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) { | 39 | if (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) { |
78 | 42 | width = root.fixedArtShapeSize.width; | 40 | width = root.fixedArtShapeSize.width; |
79 | 43 | height = root.fixedArtShapeSize.height; | 41 | height = root.fixedArtShapeSize.height; |
80 | 44 | } else if (aspectSmallerThanImageAspect) { | ||
81 | 45 | width = Qt.binding(function() { return !visible ? 0 : image.width }); | ||
82 | 46 | height = Qt.binding(function() { return !visible ? 0 : image.fillMode === Image.PreserveAspectCrop ? image.height : width / image.aspect }); | ||
83 | 47 | } else { | 42 | } else { |
86 | 48 | width = Qt.binding(function() { return !visible ? 0 : image.fillMode === Image.PreserveAspectCrop ? image.width : height * image.aspect }); | 43 | width = Qt.binding(function() { return !visible ? 0 : image.width }); |
87 | 49 | height = Qt.binding(function() { return !visible ? 0 : image.height }); | 44 | height = Qt.binding(function() { return !visible ? 0 : image.height }); |
88 | 50 | } | 45 | } |
89 | 51 | } | 46 | } |
90 | 52 | image: Image { | 47 | image: Image { |
91 | @@ -54,8 +49,7 @@ | |||
92 | 54 | source: cardData && cardData["art"] || ""; | 49 | source: cardData && cardData["art"] || ""; |
93 | 55 | cache: true; | 50 | cache: true; |
94 | 56 | asynchronous: root.asynchronous; | 51 | asynchronous: root.asynchronous; |
97 | 57 | fillMode: components && components["art"]["fill-mode"] === "fit" ? Image.PreserveAspectFit: Image.PreserveAspectCrop; | 52 | fillMode: Image.PreserveAspectCrop; |
96 | 58 | readonly property real aspect: implicitWidth / implicitHeight; | ||
98 | 59 | width: root.width; | 53 | width: root.width; |
99 | 60 | height: width / artShape.aspect; | 54 | height: width / artShape.aspect; |
100 | 61 | } | 55 | } |
101 | 62 | 56 | ||
102 | === modified file 'tests/plugins/Dash/cardcreator/1.tst' | |||
103 | --- tests/plugins/Dash/cardcreator/1.tst 2014-05-06 10:06:54 +0000 | |||
104 | +++ tests/plugins/Dash/cardcreator/1.tst 2014-08-05 18:01:59 +0000 | |||
105 | @@ -1,3 +1,3 @@ | |||
106 | 1 | template: {"card-layout":"vertical","card-size":"small","category-layout":"grid","collapsed-rows":2} | 1 | template: {"card-layout":"vertical","card-size":"small","category-layout":"grid","collapsed-rows":2} |
108 | 2 | components: {"art":{"aspect-ratio":1.6,"field":"art","fill-mode":"fit"},"title":{"field":"title"}} | 2 | components: {"art":{"aspect-ratio":1.6,"field":"art"},"title":{"field":"title"}} |
109 | 3 | result: 1.res | 3 | result: 1.res |
110 | 4 | 4 | ||
111 | === modified file 'tests/plugins/Dash/cardcreator/2.tst' | |||
112 | --- tests/plugins/Dash/cardcreator/2.tst 2014-05-06 10:10:10 +0000 | |||
113 | +++ tests/plugins/Dash/cardcreator/2.tst 2014-08-05 18:01:59 +0000 | |||
114 | @@ -1,3 +1,3 @@ | |||
115 | 1 | template: {"card-background":{"elements":["#E9E9E9"],"type":"color"},"card-layout":"vertical","card-size":"medium","category-layout":"grid","collapsed-rows":2} | 1 | template: {"card-background":{"elements":["#E9E9E9"],"type":"color"},"card-layout":"vertical","card-size":"medium","category-layout":"grid","collapsed-rows":2} |
117 | 2 | components: {"art":{"aspect-ratio":1,"fill-mode":"crop"},"background":{"field":"background"},"mascot":{"field":"icon"},"subtitle":{"field":"author"},"title":{"field":"title"}} | 2 | components: {"art":{"aspect-ratio":1},"background":{"field":"background"},"mascot":{"field":"icon"},"subtitle":{"field":"author"},"title":{"field":"title"}} |
118 | 3 | result: 2.res | 3 | result: 2.res |
119 | 4 | 4 | ||
120 | === modified file 'tests/plugins/Dash/cardcreator/3.res' | |||
121 | --- tests/plugins/Dash/cardcreator/3.res 2014-07-24 10:03:58 +0000 | |||
122 | +++ tests/plugins/Dash/cardcreator/3.res 2014-08-05 18:01:59 +0000 | |||
123 | @@ -25,7 +25,7 @@ | |||
124 | 25 | objectName: "artShapeLoader"; | 25 | objectName: "artShapeLoader"; |
125 | 26 | active: cardData && cardData["art"] || false; | 26 | active: cardData && cardData["art"] || false; |
126 | 27 | asynchronous: root.asynchronous; | 27 | asynchronous: root.asynchronous; |
128 | 28 | visible: status == Loader.Ready; | 28 | visible: status == Loader.Ready; |
129 | 29 | sourceComponent: UbuntuShape { | 29 | sourceComponent: UbuntuShape { |
130 | 30 | id: artShape; | 30 | id: artShape; |
131 | 31 | objectName: "artShape"; | 31 | objectName: "artShape"; |
132 | @@ -33,20 +33,15 @@ | |||
133 | 33 | visible: image.status == Image.Ready; | 33 | visible: image.status == Image.Ready; |
134 | 34 | readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1; | 34 | readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1; |
135 | 35 | readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1; | 35 | readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1; |
136 | 36 | readonly property bool aspectSmallerThanImageAspect: aspect < image.aspect; | ||
137 | 37 | Component.onCompleted: { updateWidthHeightBindings(); if (artShapeBorderSource !== undefined) borderSource = artShapeBorderSource; } | 36 | Component.onCompleted: { updateWidthHeightBindings(); if (artShapeBorderSource !== undefined) borderSource = artShapeBorderSource; } |
138 | 38 | onAspectSmallerThanImageAspectChanged: updateWidthHeightBindings(); | ||
139 | 39 | Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); } | 37 | Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); } |
140 | 40 | function updateWidthHeightBindings() { | 38 | function updateWidthHeightBindings() { |
141 | 41 | if (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) { | 39 | if (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) { |
142 | 42 | width = root.fixedArtShapeSize.width; | 40 | width = root.fixedArtShapeSize.width; |
143 | 43 | height = root.fixedArtShapeSize.height; | 41 | height = root.fixedArtShapeSize.height; |
144 | 44 | } else if (aspectSmallerThanImageAspect) { | ||
145 | 45 | width = Qt.binding(function() { return !visible ? 0 : image.width }); | ||
146 | 46 | height = Qt.binding(function() { return !visible ? 0 : image.fillMode === Image.PreserveAspectCrop ? image.height : width / image.aspect }); | ||
147 | 47 | } else { | 42 | } else { |
150 | 48 | width = Qt.binding(function() { return !visible ? 0 : image.fillMode === Image.PreserveAspectCrop ? image.width : height * image.aspect }); | 43 | width = Qt.binding(function() { return !visible ? 0 : image.width }); |
151 | 49 | height = Qt.binding(function() { return !visible ? 0 : image.height }); | 44 | height = Qt.binding(function() { return !visible ? 0 : image.height }); |
152 | 50 | } | 45 | } |
153 | 51 | } | 46 | } |
154 | 52 | image: Image { | 47 | image: Image { |
155 | @@ -54,8 +49,7 @@ | |||
156 | 54 | source: cardData && cardData["art"] || ""; | 49 | source: cardData && cardData["art"] || ""; |
157 | 55 | cache: true; | 50 | cache: true; |
158 | 56 | asynchronous: root.asynchronous; | 51 | asynchronous: root.asynchronous; |
161 | 57 | fillMode: components && components["art"]["fill-mode"] === "fit" ? Image.PreserveAspectFit: Image.PreserveAspectCrop; | 52 | fillMode: Image.PreserveAspectCrop; |
160 | 58 | readonly property real aspect: implicitWidth / implicitHeight; | ||
162 | 59 | width: root.width; | 53 | width: root.width; |
163 | 60 | height: width / artShape.aspect; | 54 | height: width / artShape.aspect; |
164 | 61 | } | 55 | } |
165 | 62 | 56 | ||
166 | === modified file 'tests/plugins/Dash/cardcreator/3.tst' | |||
167 | --- tests/plugins/Dash/cardcreator/3.tst 2014-05-06 10:10:10 +0000 | |||
168 | +++ tests/plugins/Dash/cardcreator/3.tst 2014-08-05 18:01:59 +0000 | |||
169 | @@ -1,3 +1,3 @@ | |||
170 | 1 | template: {"card-layout":"vertical","card-size":"small","category-layout":"grid","collapsed-rows":2} | 1 | template: {"card-layout":"vertical","card-size":"small","category-layout":"grid","collapsed-rows":2} |
172 | 2 | components: {"art":{"aspect-ratio":0.75,"field":"art","fill-mode":"crop"},"subtitle":{"field":"price"},"title":{"field":"title"}} | 2 | components: {"art":{"aspect-ratio":0.75,"field":"art"},"subtitle":{"field":"price"},"title":{"field":"title"}} |
173 | 3 | result: 3.res | 3 | result: 3.res |
174 | 4 | 4 | ||
175 | === modified file 'tests/plugins/Dash/cardcreator/4.tst' | |||
176 | --- tests/plugins/Dash/cardcreator/4.tst 2014-05-06 10:06:54 +0000 | |||
177 | +++ tests/plugins/Dash/cardcreator/4.tst 2014-08-05 18:01:59 +0000 | |||
178 | @@ -1,3 +1,3 @@ | |||
179 | 1 | template: {"card-layout":"horizontal","card-size":"large","category-layout":"grid","collapsed-rows":2} | 1 | template: {"card-layout":"horizontal","card-size":"large","category-layout":"grid","collapsed-rows":2} |
181 | 2 | components: {"art":{"aspect-ratio":1,"fill-mode":"crop"},"mascot":{"field":"mascot"},"subtitle":{"field":"domain"},"title":{"field":"title"}} | 2 | components: {"art":{"aspect-ratio":1},"mascot":{"field":"mascot"},"subtitle":{"field":"domain"},"title":{"field":"title"}} |
182 | 3 | result: 4.res | 3 | result: 4.res |
183 | 4 | 4 | ||
184 | === modified file 'tests/plugins/Dash/cardcreator/5.res' | |||
185 | --- tests/plugins/Dash/cardcreator/5.res 2014-07-24 10:03:58 +0000 | |||
186 | +++ tests/plugins/Dash/cardcreator/5.res 2014-08-05 18:01:59 +0000 | |||
187 | @@ -25,7 +25,7 @@ | |||
188 | 25 | objectName: "artShapeLoader"; | 25 | objectName: "artShapeLoader"; |
189 | 26 | active: cardData && cardData["art"] || false; | 26 | active: cardData && cardData["art"] || false; |
190 | 27 | asynchronous: root.asynchronous; | 27 | asynchronous: root.asynchronous; |
192 | 28 | visible: status == Loader.Ready; | 28 | visible: status == Loader.Ready; |
193 | 29 | sourceComponent: UbuntuShape { | 29 | sourceComponent: UbuntuShape { |
194 | 30 | id: artShape; | 30 | id: artShape; |
195 | 31 | objectName: "artShape"; | 31 | objectName: "artShape"; |
196 | @@ -33,20 +33,15 @@ | |||
197 | 33 | visible: image.status == Image.Ready; | 33 | visible: image.status == Image.Ready; |
198 | 34 | readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1; | 34 | readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1; |
199 | 35 | readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1; | 35 | readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1; |
200 | 36 | readonly property bool aspectSmallerThanImageAspect: aspect < image.aspect; | ||
201 | 37 | Component.onCompleted: { updateWidthHeightBindings(); if (artShapeBorderSource !== undefined) borderSource = artShapeBorderSource; } | 36 | Component.onCompleted: { updateWidthHeightBindings(); if (artShapeBorderSource !== undefined) borderSource = artShapeBorderSource; } |
202 | 38 | onAspectSmallerThanImageAspectChanged: updateWidthHeightBindings(); | ||
203 | 39 | Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); } | 37 | Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); } |
204 | 40 | function updateWidthHeightBindings() { | 38 | function updateWidthHeightBindings() { |
205 | 41 | if (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) { | 39 | if (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) { |
206 | 42 | width = root.fixedArtShapeSize.width; | 40 | width = root.fixedArtShapeSize.width; |
207 | 43 | height = root.fixedArtShapeSize.height; | 41 | height = root.fixedArtShapeSize.height; |
208 | 44 | } else if (aspectSmallerThanImageAspect) { | ||
209 | 45 | width = Qt.binding(function() { return !visible ? 0 : image.width }); | ||
210 | 46 | height = Qt.binding(function() { return !visible ? 0 : image.fillMode === Image.PreserveAspectCrop ? image.height : width / image.aspect }); | ||
211 | 47 | } else { | 42 | } else { |
214 | 48 | width = Qt.binding(function() { return !visible ? 0 : image.fillMode === Image.PreserveAspectCrop ? image.width : height * image.aspect }); | 43 | width = Qt.binding(function() { return !visible ? 0 : image.width }); |
215 | 49 | height = Qt.binding(function() { return !visible ? 0 : image.height }); | 44 | height = Qt.binding(function() { return !visible ? 0 : image.height }); |
216 | 50 | } | 45 | } |
217 | 51 | } | 46 | } |
218 | 52 | image: Image { | 47 | image: Image { |
219 | @@ -54,13 +49,12 @@ | |||
220 | 54 | source: cardData && cardData["art"] || ""; | 49 | source: cardData && cardData["art"] || ""; |
221 | 55 | cache: true; | 50 | cache: true; |
222 | 56 | asynchronous: root.asynchronous; | 51 | asynchronous: root.asynchronous; |
225 | 57 | fillMode: components && components["art"]["fill-mode"] === "fit" ? Image.PreserveAspectFit: Image.PreserveAspectCrop; | 52 | fillMode: Image.PreserveAspectCrop; |
224 | 58 | readonly property real aspect: implicitWidth / implicitHeight; | ||
226 | 59 | width: root.width; | 53 | width: root.width; |
227 | 60 | height: width / artShape.aspect; | 54 | height: width / artShape.aspect; |
228 | 61 | } | 55 | } |
229 | 62 | } | 56 | } |
231 | 63 | } | 57 | } |
232 | 64 | } | 58 | } |
233 | 65 | Loader { | 59 | Loader { |
234 | 66 | id: overlayLoader; | 60 | id: overlayLoader; |
235 | @@ -69,7 +63,7 @@ | |||
236 | 69 | right: artShapeHolder.right; | 63 | right: artShapeHolder.right; |
237 | 70 | bottom: artShapeHolder.bottom; | 64 | bottom: artShapeHolder.bottom; |
238 | 71 | } | 65 | } |
240 | 72 | active: artShapeLoader.active && artShapeLoader.item && artShapeLoader.item.image.status === Image.Ready || false; | 66 | active: artShapeLoader.active && artShapeLoader.item && artShapeLoader.item.image.status === Image.Ready || false; |
241 | 73 | asynchronous: root.asynchronous; | 67 | asynchronous: root.asynchronous; |
242 | 74 | visible: showHeader && status == Loader.Ready; | 68 | visible: showHeader && status == Loader.Ready; |
243 | 75 | sourceComponent: ShaderEffect { | 69 | sourceComponent: ShaderEffect { |
244 | 76 | 70 | ||
245 | === modified file 'tests/plugins/Dash/cardcreator/5.tst' | |||
246 | --- tests/plugins/Dash/cardcreator/5.tst 2014-05-06 11:16:46 +0000 | |||
247 | +++ tests/plugins/Dash/cardcreator/5.tst 2014-08-05 18:01:59 +0000 | |||
248 | @@ -1,3 +1,3 @@ | |||
249 | 1 | template: {"card-layout":"vertical","card-size":"medium","category-layout":"carousel","collapsed-rows":2,"overlay":true} | 1 | template: {"card-layout":"vertical","card-size":"medium","category-layout":"carousel","collapsed-rows":2,"overlay":true} |
251 | 2 | components: {"art":{"aspect-ratio":1,"field":"art","fill-mode":"crop"},"subtitle":{"field":"artist"},"title":{"field":"title"}} | 2 | components: {"art":{"aspect-ratio":1,"field":"art"},"subtitle":{"field":"artist"},"title":{"field":"title"}} |
252 | 3 | result: 5.res | 3 | result: 5.res |
253 | 4 | 4 | ||
254 | === modified file 'tests/plugins/Dash/cardcreator/6.res' | |||
255 | --- tests/plugins/Dash/cardcreator/6.res 2014-07-10 18:03:16 +0000 | |||
256 | +++ tests/plugins/Dash/cardcreator/6.res 2014-08-05 18:01:59 +0000 | |||
257 | @@ -33,19 +33,14 @@ | |||
258 | 33 | visible: image.status == Image.Ready; | 33 | visible: image.status == Image.Ready; |
259 | 34 | readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1; | 34 | readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1; |
260 | 35 | readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1; | 35 | readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1; |
261 | 36 | readonly property bool aspectSmallerThanImageAspect: aspect < image.aspect; | ||
262 | 37 | Component.onCompleted: { updateWidthHeightBindings(); if (artShapeBorderSource !== undefined) borderSource = artShapeBorderSource; } | 36 | Component.onCompleted: { updateWidthHeightBindings(); if (artShapeBorderSource !== undefined) borderSource = artShapeBorderSource; } |
263 | 38 | onAspectSmallerThanImageAspectChanged: updateWidthHeightBindings(); | ||
264 | 39 | Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); } | 37 | Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); } |
265 | 40 | function updateWidthHeightBindings() { | 38 | function updateWidthHeightBindings() { |
266 | 41 | if (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) { | 39 | if (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) { |
267 | 42 | width = root.fixedArtShapeSize.width; | 40 | width = root.fixedArtShapeSize.width; |
268 | 43 | height = root.fixedArtShapeSize.height; | 41 | height = root.fixedArtShapeSize.height; |
270 | 44 | } else if (aspectSmallerThanImageAspect) { | 42 | } else { |
271 | 45 | width = Qt.binding(function() { return !visible ? 0 : image.width }); | 43 | width = Qt.binding(function() { return !visible ? 0 : image.width }); |
272 | 46 | height = Qt.binding(function() { return !visible ? 0 : image.fillMode === Image.PreserveAspectCrop ? image.height : width / image.aspect }); | ||
273 | 47 | } else { | ||
274 | 48 | width = Qt.binding(function() { return !visible ? 0 : image.fillMode === Image.PreserveAspectCrop ? image.width : height * image.aspect }); | ||
275 | 49 | height = Qt.binding(function() { return !visible ? 0 : image.height }); | 44 | height = Qt.binding(function() { return !visible ? 0 : image.height }); |
276 | 50 | } | 45 | } |
277 | 51 | } | 46 | } |
278 | @@ -54,8 +49,7 @@ | |||
279 | 54 | source: cardData && cardData["art"] || ""; | 49 | source: cardData && cardData["art"] || ""; |
280 | 55 | cache: true; | 50 | cache: true; |
281 | 56 | asynchronous: root.asynchronous; | 51 | asynchronous: root.asynchronous; |
284 | 57 | fillMode: components && components["art"]["fill-mode"] === "fit" ? Image.PreserveAspectFit: Image.PreserveAspectCrop; | 52 | fillMode: Image.PreserveAspectCrop; |
283 | 58 | readonly property real aspect: implicitWidth / implicitHeight; | ||
285 | 59 | width: root.width; | 53 | width: root.width; |
286 | 60 | height: width / artShape.aspect; | 54 | height: width / artShape.aspect; |
287 | 61 | } | 55 | } |
288 | 62 | 56 | ||
289 | === modified file 'tests/plugins/Dash/cardcreator/6.tst' | |||
290 | --- tests/plugins/Dash/cardcreator/6.tst 2014-07-08 09:50:44 +0000 | |||
291 | +++ tests/plugins/Dash/cardcreator/6.tst 2014-08-05 18:01:59 +0000 | |||
292 | @@ -1,3 +1,3 @@ | |||
293 | 1 | template: {"card-layout":"vertical","card-size":"small","category-layout":"grid","collapsed-rows":2} | 1 | template: {"card-layout":"vertical","card-size":"small","category-layout":"grid","collapsed-rows":2} |
295 | 2 | components: {"art":{"aspect-ratio":1.6,"field":"art","fill-mode":"fit"}} | 2 | components: {"art":{"aspect-ratio":1.6,"field":"art"}} |
296 | 3 | result: 6.res | 3 | result: 6.res |
297 | 4 | 4 | ||
298 | === modified file 'tests/plugins/Dash/cardcreator/7.res' | |||
299 | --- tests/plugins/Dash/cardcreator/7.res 2014-07-24 10:03:58 +0000 | |||
300 | +++ tests/plugins/Dash/cardcreator/7.res 2014-08-05 18:01:59 +0000 | |||
301 | @@ -116,7 +116,7 @@ | |||
302 | 116 | objectName: "attributesRow"; | 116 | objectName: "attributesRow"; |
303 | 117 | anchors { left: parent.left; right: parent.right } | 117 | anchors { left: parent.left; right: parent.right } |
304 | 118 | color: backgroundLoader.active && backgroundLoader.item && backgroundLoader.item.luminance < 0.7 ? "white" : (root.scopeStyle ? root.scopeStyle.foreground : "grey"); | 118 | color: backgroundLoader.active && backgroundLoader.item && backgroundLoader.item.luminance < 0.7 ? "white" : (root.scopeStyle ? root.scopeStyle.foreground : "grey"); |
306 | 119 | model: cardData["attributes"] | 119 | model: cardData && cardData["attributes"] || undefined; |
307 | 120 | } | 120 | } |
308 | 121 | 121 | ||
309 | 122 | ] | 122 | ] |
310 | 123 | 123 | ||
311 | === modified file 'tests/plugins/Dash/cardcreator/7.tst' | |||
312 | --- tests/plugins/Dash/cardcreator/7.tst 2014-07-25 15:11:33 +0000 | |||
313 | +++ tests/plugins/Dash/cardcreator/7.tst 2014-08-05 18:01:59 +0000 | |||
314 | @@ -1,3 +1,3 @@ | |||
315 | 1 | template: {"card-background":{"elements":["#E9E9E9"],"type":"color"},"card-layout":"vertical","card-size":"medium","category-layout":"grid","collapsed-rows":2} | 1 | template: {"card-background":{"elements":["#E9E9E9"],"type":"color"},"card-layout":"vertical","card-size":"medium","category-layout":"grid","collapsed-rows":2} |
317 | 2 | components: {"art":{"aspect-ratio":1,"fill-mode":"crop"},"background":{"field":"background"},"mascot":{"field":"icon"},"subtitle":{"field":"author"},"title":{"field":"title"},"attributes":{"field":"attributes","max-count":2}} | 2 | components: {"art":{"aspect-ratio":1},"background":{"field":"background"},"mascot":{"field":"icon"},"subtitle":{"field":"author"},"title":{"field":"title"},"attributes":{"field":"attributes","max-count":2}} |
318 | 3 | result: 7.res | 3 | result: 7.res |
319 | 4 | 4 | ||
320 | === modified file 'tests/qmltests/Dash/CardHelpers.js' | |||
321 | --- tests/qmltests/Dash/CardHelpers.js 2014-07-25 15:11:33 +0000 | |||
322 | +++ tests/qmltests/Dash/CardHelpers.js 2014-08-05 18:01:59 +0000 | |||
323 | @@ -31,8 +31,7 @@ | |||
324 | 31 | "components": { \ | 31 | "components": { \ |
325 | 32 | "title": null, \ | 32 | "title": null, \ |
326 | 33 | "art": { \ | 33 | "art": { \ |
329 | 34 | "aspect-ratio": 1.0, \ | 34 | "aspect-ratio": 1.0 \ |
328 | 35 | "fill-mode": "crop" \ | ||
330 | 36 | }, \ | 35 | }, \ |
331 | 37 | "subtitle": null, \ | 36 | "subtitle": null, \ |
332 | 38 | "mascot": null, \ | 37 | "mascot": null, \ |
333 | 39 | 38 | ||
334 | === modified file 'tests/qmltests/Dash/tst_Card.qml' | |||
335 | --- tests/qmltests/Dash/tst_Card.qml 2014-07-31 16:49:38 +0000 | |||
336 | +++ tests/qmltests/Dash/tst_Card.qml 2014-08-05 18:01:59 +0000 | |||
337 | @@ -55,8 +55,8 @@ | |||
338 | 55 | "layout": { "components": Helpers.update(JSON.parse(Helpers.fullMapping), { "art": { "aspect-ratio": 2 } }) } | 55 | "layout": { "components": Helpers.update(JSON.parse(Helpers.fullMapping), { "art": { "aspect-ratio": 2 } }) } |
339 | 56 | }, | 56 | }, |
340 | 57 | { | 57 | { |
343 | 58 | "name": "Art, title - fitted", | 58 | "name": "Art, title - tall", |
344 | 59 | "layout": { "components": Helpers.update(JSON.parse(Helpers.fullMapping), { "art": { "fill-mode": "fit" } }) } | 59 | "layout": { "components": Helpers.update(JSON.parse(Helpers.fullMapping), { "art": { "aspect-ratio": 0.7 } }) } |
345 | 60 | }, | 60 | }, |
346 | 61 | { | 61 | { |
347 | 62 | "name": "Art, header, summary - horizontal", | 62 | "name": "Art, header, summary - horizontal", |
348 | @@ -269,7 +269,7 @@ | |||
349 | 269 | { tag: "Small", width: units.gu(12), index: 1 }, | 269 | { tag: "Small", width: units.gu(12), index: 1 }, |
350 | 270 | { tag: "Large", width: units.gu(38), index: 2 }, | 270 | { tag: "Large", width: units.gu(38), index: 2 }, |
351 | 271 | { tag: "Wide", height: units.gu(19), size: "large", index: 3 }, | 271 | { tag: "Wide", height: units.gu(19), size: "large", index: 3 }, |
353 | 272 | { tag: "Fit", height: units.gu(38), size: "large", width: units.gu(19), index: 4 }, | 272 | { tag: "Tall", height: units.gu(38) / 0.7, size: "large", width: units.gu(38), index: 4 }, |
354 | 273 | { tag: "VerticalWidth", width: function() { return headerRow.width + units.gu(1) * 2 }, index: 0 }, | 273 | { tag: "VerticalWidth", width: function() { return headerRow.width + units.gu(1) * 2 }, index: 0 }, |
355 | 274 | { tag: "HorizontalHeight", height: function() { return headerRow.height + units.gu(1) * 2 }, index: 5 }, | 274 | { tag: "HorizontalHeight", height: function() { return headerRow.height + units.gu(1) * 2 }, index: 5 }, |
356 | 275 | { tag: "HorizontalWidth", width: function() { return headerRow.x - units.gu(1) }, index: 5 }, | 275 | { tag: "HorizontalWidth", width: function() { return headerRow.x - units.gu(1) }, index: 5 }, |
357 | 276 | 276 | ||
358 | === modified file 'tests/qmltests/Dash/tst_GenericScopeView.qml' | |||
359 | --- tests/qmltests/Dash/tst_GenericScopeView.qml 2014-07-24 20:40:57 +0000 | |||
360 | +++ tests/qmltests/Dash/tst_GenericScopeView.qml 2014-08-05 18:01:59 +0000 | |||
361 | @@ -129,8 +129,9 @@ | |||
362 | 129 | var initialHeight = category.height; | 129 | var initialHeight = category.height; |
363 | 130 | mouseClick(seeAll, seeAll.width / 2, seeAll.height / 2); | 130 | mouseClick(seeAll, seeAll.width / 2, seeAll.height / 2); |
364 | 131 | verify(category.expanded); | 131 | verify(category.expanded); |
366 | 132 | tryCompareFunction(function() { return category.height > initialHeight; }, true); | 132 | tryCompare(category, "height", category.item.expandedHeight + seeAll.height); |
367 | 133 | 133 | ||
368 | 134 | waitForRendering(seeAll); | ||
369 | 134 | mouseClick(seeAll, seeAll.width / 2, seeAll.height / 2); | 135 | mouseClick(seeAll, seeAll.width / 2, seeAll.height / 2); |
370 | 135 | verify(!category.expanded); | 136 | verify(!category.expanded); |
371 | 136 | } | 137 | } |
FAILED: Continuous integration, rev:1088 jenkins. qa.ubuntu. com/job/ unity8- ci/3641/ jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- utopic- touch/2583 jenkins. qa.ubuntu. com/job/ unity-phablet- qmluitests- utopic/ 643 jenkins. qa.ubuntu. com/job/ unity8- utopic- amd64-ci/ 735 jenkins. qa.ubuntu. com/job/ unity8- utopic- armhf-ci/ 735 jenkins. qa.ubuntu. com/job/ unity8- utopic- armhf-ci/ 735/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ unity8- utopic- i386-ci/ 735 jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- runner- mako/2723 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- armhf/3826 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- armhf/3826/ artifact/ work/output/ *zip*/output. zip s-jenkins. ubuntu- ci:8080/ job/touch- flash-device/ 10541
http://
Executed test runs:
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/unity8- ci/3641/ rebuild
http://