Merge lp:~cimi/unity8/card-shadows-uitk1.1 into lp:unity8

Proposed by Andrea Cimitan on 2015-06-15
Status: Work in progress
Proposed branch: lp:~cimi/unity8/card-shadows-uitk1.1
Merge into: lp:unity8
Diff against target: 498 lines (+116/-31)
14 files modified
plugins/Dash/CMakeLists.txt (+2/-0)
plugins/Dash/CardCreator.js (+23/-5)
qml/Components/ResponsiveGridView.qml (+1/-0)
qml/Dash/CardCarousel.qml (+1/-1)
qml/Dash/CardGrid.qml (+5/-0)
qml/Dash/GenericScopeView.qml (+2/-2)
tests/mocks/Unity/fake_categories.cpp (+5/-0)
tests/plugins/Dash/cardcreator/1.res (+23/-5)
tests/plugins/Dash/cardcreator/2.res (+2/-2)
tests/plugins/Dash/cardcreator/3.res (+23/-5)
tests/plugins/Dash/cardcreator/4.res (+2/-2)
tests/plugins/Dash/cardcreator/5.res (+23/-5)
tests/plugins/Dash/cardcreator/6.res (+2/-2)
tests/plugins/Dash/cardcreator/7.res (+2/-2)
To merge this branch: bzr merge lp:~cimi/unity8/card-shadows-uitk1.1
Reviewer Review Type Date Requested Status
Andrea Cimitan (community) Needs Information on 2015-06-25
PS Jenkins bot continuous-integration Needs Fixing on 2015-06-25
Albert Astals Cid (community) 2015-06-15 Needs Information on 2015-06-23
Review via email: mp+261977@code.launchpad.net

Commit Message

add dropshadow to application scope

Description of the Change

 * Are there any related MPs required for this MP to build/function as expected? Please list.
No, but other apps to ship new icons
 * 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?
yes
 * Did you have a look at the warnings when running tests? Can they be reduced?
no new warnings, many come from UITK

To post a comment you must log in.
lp:~cimi/unity8/card-shadows-uitk1.1 updated on 2015-06-15
1801. By Andrea Cimitan on 2015-06-15

Minor tweak to comment

Albert Astals Cid (aacid) wrote :

Why do we need the export_qmlfiles ?

review: Needs Information
Albert Astals Cid (aacid) wrote :

Can maybe we make

  readonly property var artShapeStyle: cardTool.artShapeSize === Qt.size(units.gu(8), units.gu(7.5)) ? "shadow" : "inset";

a bit less hackish if we pass the scope name or something from above?

review: Needs Information
Andrea Cimitan (cimi) wrote :

> Why do we need the export_qmlfiles ?

this export the png files in the installation directory

> Can maybe we make
>
> readonly property var artShapeStyle: cardTool.artShapeSize === Qt.size(units.gu(8), units.gu(7.5)) ? "shadow" : "inset";
>
> a bit less hackish if we pass the scope name or something from above?

This would also require to copy/paste the other logic in place, like "if (scope && scope.id === "clickscope" && (categoryId === "predefined" || categoryId === "local"))"

Albert Astals Cid (aacid) wrote :

> > Can maybe we make
> >
> > readonly property var artShapeStyle: cardTool.artShapeSize ===
> Qt.size(units.gu(8), units.gu(7.5)) ? "shadow" : "inset";
> >
> > a bit less hackish if we pass the scope name or something from above?
>
> This would also require to copy/paste the other logic in place, like "if
> (scope && scope.id === "clickscope" && (categoryId === "predefined" ||
> categoryId === "local"))"

My concern is, is it possible than something else than the clickscope can have Qt.size(units.gu(8), units.gu(7.5)) ?

Also if we're going to go with this hack we should document in GenericScopeView.qml that this depends on that sizing in case it changes someone should come here and change it too

lp:~cimi/unity8/card-shadows-uitk1.1 updated on 2015-06-24
1802. By Andrea Cimitan on 2015-06-24

Minor tests

1803. By Andrea Cimitan on 2015-06-24

Tweaks to shadow looks when pressed

1804. By Andrea Cimitan on 2015-06-24

Asset updated

Andrea Cimitan (cimi) wrote :

> > > Can maybe we make
> > >
> > > readonly property var artShapeStyle: cardTool.artShapeSize ===
> > Qt.size(units.gu(8), units.gu(7.5)) ? "shadow" : "inset";
> > >
> > > a bit less hackish if we pass the scope name or something from above?
> >
> > This would also require to copy/paste the other logic in place, like "if
> > (scope && scope.id === "clickscope" && (categoryId === "predefined" ||
> > categoryId === "local"))"
>
> My concern is, is it possible than something else than the clickscope can have
> Qt.size(units.gu(8), units.gu(7.5)) ?
>
> Also if we're going to go with this hack we should document in
> GenericScopeView.qml that this depends on that sizing in case it changes
> someone should come here and change it too

done, changed to 8x7.4 as should be

lp:~cimi/unity8/card-shadows-uitk1.1 updated on 2015-06-24
1805. By Andrea Cimitan on 2015-06-24

Merged trunk

lp:~cimi/unity8/card-shadows-uitk1.1 updated on 2015-06-24
1806. By Andrea Cimitan on 2015-06-24

Less topMargin is required

1807. By Andrea Cimitan on 2015-06-24

Added small comment

lp:~cimi/unity8/card-shadows-uitk1.1 updated on 2015-06-25
1808. By Andrea Cimitan on 2015-06-25

Removed highlight because makes krillin crash

Andrea Cimitan (cimi) wrote :

Performance seems bad on krillin.... we need to put those images into shaders... I'd wait few weeks

review: Needs Information

Unmerged revisions

1808. By Andrea Cimitan on 2015-06-25

Removed highlight because makes krillin crash

1807. By Andrea Cimitan on 2015-06-24

Added small comment

1806. By Andrea Cimitan on 2015-06-24

Less topMargin is required

1805. By Andrea Cimitan on 2015-06-24

Merged trunk

1804. By Andrea Cimitan on 2015-06-24

Asset updated

1803. By Andrea Cimitan on 2015-06-24

Tweaks to shadow looks when pressed

1802. By Andrea Cimitan on 2015-06-24

Minor tests

1801. By Andrea Cimitan on 2015-06-15

Minor tweak to comment

1800. By Andrea Cimitan on 2015-06-15

Merge trunk

1799. By Andrea Cimitan on 2015-06-15

Just add some tweaks to the app scope mock

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/Dash/CMakeLists.txt'
2--- plugins/Dash/CMakeLists.txt 2014-11-24 10:11:05 +0000
3+++ plugins/Dash/CMakeLists.txt 2015-06-25 13:59:12 +0000
4@@ -37,6 +37,8 @@
5 ${Qt5Quick_LIBRARIES}
6 )
7
8+export_qmlfiles(${PLUGIN} ${PATH} DESTINATION ${SHELL_INSTALL_QML}/Dash ${ARGN})
9+
10 qt5_use_modules(Dash-qml Qml Quick Concurrent)
11
12 add_unity8_plugin(Dash 0.1 Dash TARGETS Dash-qml)
13
14=== modified file 'plugins/Dash/CardCreator.js'
15--- plugins/Dash/CardCreator.js 2015-06-18 19:39:17 +0000
16+++ plugins/Dash/CardCreator.js 2015-06-25 13:59:12 +0000
17@@ -66,7 +66,8 @@
18 sourceComponent: Item { \n\
19 id: artShape; \n\
20 objectName: "artShape"; \n\
21- property bool doShapeItem: components["art"]["conciergeMode"] !== true; \n\
22+ readonly property bool doShadow: root.artShapeStyle === "shadow"; \n\
23+ readonly property bool doShapeItem: components["art"]["conciergeMode"] !== true; \n\
24 visible: image.status == Image.Ready; \n\
25 readonly property alias image: artImage.image; \n\
26 property alias borderSource: artShapeShape.borderSource; \n\
27@@ -84,10 +85,11 @@
28 anchors.fill: parent; \n\
29 visible: doShapeItem; \n\
30 radius: "medium"; \n\
31+ borderSource: root.artShapeStyle === "inset" ? "radius_idle.sci" : "none"; \n\
32 } \n\
33 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1; \n\
34 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1; \n\
35- Component.onCompleted: { updateWidthHeightBindings(); if (artShapeBorderSource !== undefined) borderSource = artShapeBorderSource; } \n\
36+ Component.onCompleted: { updateWidthHeightBindings(); } \n\
37 Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); } \n\
38 function updateWidthHeightBindings() { \n\
39 if (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) { \n\
40@@ -106,6 +108,23 @@
41 width: %2; \n\
42 height: %3; \n\
43 } \n\
44+ Image { \n\
45+ anchors.centerIn: parent; \n\
46+ source: "shadow.png"; \n\
47+ width: parent.width + units.gu(1); \n\
48+ height: parent.height + units.gu(1); \n\
49+ fillMode: Image.PreserveAspectCrop; \n\
50+ visible: doShadow; \n\
51+ z: -1; \n\
52+ } \n\
53+ BorderImage { \n\
54+ anchors.centerIn: parent; \n\
55+ source: "bevel.png"; \n\
56+ width: parent.width; \n\
57+ height: parent.height; \n\
58+ visible: doShadow; \n\
59+ z: 1; \n\
60+ } \n
61 } \n\
62 } \n\
63 }\n';
64@@ -259,7 +278,7 @@
65 id: touchdown; \n\
66 objectName: "touchdown"; \n\
67 anchors { %1 } \n\
68- visible: root.pressed; \n\
69+ visible: root.artShapeStyle != "shadow" && root.pressed; \n\
70 radius: "medium"; \n\
71 borderSource: "radius_pressed.sci" \n\
72 }\n';
73@@ -323,7 +342,7 @@
74 id: root; \n\
75 property var components; \n\
76 property var cardData; \n\
77- property var artShapeBorderSource: undefined; \n\
78+ property string artShapeStyle: "inset"; \n\
79 property real fontScale: 1.0; \n\
80 property var scopeStyle: null; \n\
81 property int titleAlignment: Text.AlignLeft; \n\
82@@ -366,7 +385,6 @@
83 }
84
85 if (hasArt) {
86- code += 'onArtShapeBorderSourceChanged: { if (artShapeBorderSource !== undefined && artShapeLoader.item) artShapeLoader.item.borderSource = artShapeBorderSource; } \n';
87 code += 'readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);\n';
88
89 var widthCode, heightCode;
90
91=== added file 'plugins/Dash/bevel@30.png'
92Binary files plugins/Dash/bevel@30.png 1970-01-01 00:00:00 +0000 and plugins/Dash/bevel@30.png 2015-06-25 13:59:12 +0000 differ
93=== added file 'plugins/Dash/shadow@30.png'
94Binary files plugins/Dash/shadow@30.png 1970-01-01 00:00:00 +0000 and plugins/Dash/shadow@30.png 2015-06-25 13:59:12 +0000 differ
95=== modified file 'qml/Components/ResponsiveGridView.qml'
96--- qml/Components/ResponsiveGridView.qml 2014-10-23 11:59:22 +0000
97+++ qml/Components/ResponsiveGridView.qml 2015-06-25 13:59:12 +0000
98@@ -50,6 +50,7 @@
99 property alias highlightIndex: gridView.highlightIndex
100 property alias cacheBuffer: gridView.cacheBuffer
101 readonly property alias currentItem: gridView.currentItem
102+ property alias topMargin: gridView.topMargin
103
104 function contentHeightForRows(rows, height) {
105 return rows * height
106
107=== modified file 'qml/Dash/CardCarousel.qml'
108--- qml/Dash/CardCarousel.qml 2015-05-13 10:21:18 +0000
109+++ qml/Dash/CardCarousel.qml 2015-06-25 13:59:12 +0000
110@@ -64,7 +64,7 @@
111 item.components = Qt.binding(function() { return cardTool.components; });
112 item.fontScale = Qt.binding(function() { return carousel.fontScale; });
113 item.showHeader = Qt.binding(function() { return loader.explicitlyScaled; });
114- item.artShapeBorderSource = "none";
115+ item.artShapeStyle = "flat";
116 item.scopeStyle = cardCarousel.scopeStyle;
117 }
118
119
120=== modified file 'qml/Dash/CardGrid.qml'
121--- qml/Dash/CardGrid.qml 2015-05-13 10:21:18 +0000
122+++ qml/Dash/CardGrid.qml 2015-06-25 13:59:12 +0000
123@@ -25,6 +25,9 @@
124 return cardTool.template["collapsed-rows"];
125 }
126
127+ // hackish, relies on GenericScopeView.qml:335 tweak to detect application icons in click scope
128+ readonly property var artShapeStyle: cardTool.artShapeSize === Qt.size(units.gu(8), units.gu(7.4)) ? "shadow" : "inset";
129+
130 expandedHeight: grid.totalContentHeight
131 collapsedHeight: Math.min(grid.contentHeightForRows(collapsedRows, grid.cellHeight), expandedHeight)
132 collapsedItemCount: collapsedRows * grid.columns
133@@ -52,6 +55,7 @@
134 displayMarginEnd: root.displayMarginEnd
135 cacheBuffer: root.cacheBuffer
136 interactive: false
137+ topMargin: root.artShapeStyle === "shadow" ? units.gu(0.1) : 0 // otherwise when we have a shadow, its top is clipped
138 delegate: Item {
139 width: grid.cellWidth
140 height: grid.cellHeight
141@@ -69,6 +73,7 @@
142 item.components = Qt.binding(function() { return cardTool.components; });
143 item.titleAlignment = Qt.binding(function() { return cardTool.titleAlignment; });
144 item.scopeStyle = root.scopeStyle;
145+ item.artShapeStyle = root.artShapeStyle;
146 }
147 Connections {
148 target: loader.item
149
150=== modified file 'qml/Dash/GenericScopeView.qml'
151--- qml/Dash/GenericScopeView.qml 2015-06-16 15:12:33 +0000
152+++ qml/Dash/GenericScopeView.qml 2015-06-25 13:59:12 +0000
153@@ -331,8 +331,8 @@
154 }
155 updateRanges();
156 if (scope && scope.id === "clickscope" && (categoryId === "predefined" || categoryId === "local")) {
157- // Yeah, hackish :/
158- cardTool.artShapeSize = Qt.size(units.gu(8), units.gu(7.5));
159+ // Yeah, hackish :/ This code is checked inside CardGrid.qml to add shadows in click scope apps, edit accordingly
160+ cardTool.artShapeSize = Qt.size(units.gu(8), units.gu(7.4));
161 }
162 item.cardTool = cardTool;
163 }
164
165=== modified file 'tests/mocks/Unity/fake_categories.cpp'
166--- tests/mocks/Unity/fake_categories.cpp 2014-08-20 08:44:08 +0000
167+++ tests/mocks/Unity/fake_categories.cpp 2015-06-25 13:59:12 +0000
168@@ -52,6 +52,11 @@
169 ResultsModel *resultsModel = resultModel(index.row());
170 switch (role) {
171 case RoleCategoryId:
172+ if (index.row() == 0) {
173+ return QString("predefined");
174+ } else if (index.row() == 2) {
175+ return QString("local");
176+ }
177 return QString("%1").arg(index.row());
178 case RoleName:
179 return QString("Category %1").arg(index.row());
180
181=== modified file 'tests/plugins/Dash/cardcreator/1.res'
182--- tests/plugins/Dash/cardcreator/1.res 2015-06-16 15:12:28 +0000
183+++ tests/plugins/Dash/cardcreator/1.res 2015-06-25 13:59:12 +0000
184@@ -2,7 +2,7 @@
185 id: root;
186 property var components;
187 property var cardData;
188- property var artShapeBorderSource: undefined;
189+ property string artShapeStyle: "inset";
190 property real fontScale: 1.0;
191 property var scopeStyle: null;
192 property int titleAlignment: Text.AlignLeft;
193@@ -14,7 +14,6 @@
194 implicitWidth: childrenRect.width;
195 enabled: true;
196
197-onArtShapeBorderSourceChanged: { if (artShapeBorderSource !== undefined && artShapeLoader.item) artShapeLoader.item.borderSource = artShapeBorderSource; }
198 readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
199 Item {
200 id: artShapeHolder;
201@@ -30,7 +29,8 @@
202 sourceComponent: Item {
203 id: artShape;
204 objectName: "artShape";
205- property bool doShapeItem: components["art"]["conciergeMode"] !== true;
206+ readonly property bool doShadow: root.artShapeStyle === "shadow";
207+ readonly property bool doShapeItem: components["art"]["conciergeMode"] !== true;
208 visible: image.status == Image.Ready;
209 readonly property alias image: artImage.image;
210 property alias borderSource: artShapeShape.borderSource;
211@@ -48,10 +48,11 @@
212 anchors.fill: parent;
213 visible: doShapeItem;
214 radius: "medium";
215+ borderSource: root.artShapeStyle === "inset" ? "radius_idle.sci" : "none";
216 }
217 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
218 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1;
219- Component.onCompleted: { updateWidthHeightBindings(); if (artShapeBorderSource !== undefined) borderSource = artShapeBorderSource; }
220+ Component.onCompleted: { updateWidthHeightBindings(); }
221 Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); }
222 function updateWidthHeightBindings() {
223 if (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) {
224@@ -70,6 +71,23 @@
225 width: root.width;
226 height: width / artShape.aspect;
227 }
228+ Image {
229+ anchors.centerIn: parent;
230+ source: "shadow.png";
231+ width: parent.width + units.gu(1);
232+ height: parent.height + units.gu(1);
233+ fillMode: Image.PreserveAspectCrop;
234+ visible: doShadow;
235+ z: -1;
236+ }
237+ BorderImage {
238+ anchors.centerIn: parent;
239+ source: "bevel.png";
240+ width: parent.width;
241+ height: parent.height;
242+ visible: doShadow;
243+ z: 1;
244+ }
245 }
246 }
247 }
248@@ -97,7 +115,7 @@
249 id: touchdown;
250 objectName: "touchdown";
251 anchors { fill: artShapeHolder }
252- visible: root.pressed;
253+ visible: root.artShapeStyle != "shadow" && root.pressed;
254 radius: "medium";
255 borderSource: "radius_pressed.sci"
256 }
257
258=== modified file 'tests/plugins/Dash/cardcreator/2.res'
259--- tests/plugins/Dash/cardcreator/2.res 2015-05-13 10:21:18 +0000
260+++ tests/plugins/Dash/cardcreator/2.res 2015-06-25 13:59:12 +0000
261@@ -2,7 +2,7 @@
262 id: root;
263 property var components;
264 property var cardData;
265- property var artShapeBorderSource: undefined;
266+ property string artShapeStyle: "inset";
267 property real fontScale: 1.0;
268 property var scopeStyle: null;
269 property int titleAlignment: Text.AlignLeft;
270@@ -122,7 +122,7 @@
271 id: touchdown;
272 objectName: "touchdown";
273 anchors { fill: backgroundLoader }
274- visible: root.pressed;
275+ visible: root.artShapeStyle != "shadow" && root.pressed;
276 radius: "medium";
277 borderSource: "radius_pressed.sci"
278 }
279
280=== modified file 'tests/plugins/Dash/cardcreator/3.res'
281--- tests/plugins/Dash/cardcreator/3.res 2015-06-16 15:12:28 +0000
282+++ tests/plugins/Dash/cardcreator/3.res 2015-06-25 13:59:12 +0000
283@@ -2,7 +2,7 @@
284 id: root;
285 property var components;
286 property var cardData;
287- property var artShapeBorderSource: undefined;
288+ property string artShapeStyle: "inset";
289 property real fontScale: 1.0;
290 property var scopeStyle: null;
291 property int titleAlignment: Text.AlignLeft;
292@@ -14,7 +14,6 @@
293 implicitWidth: childrenRect.width;
294 enabled: true;
295
296-onArtShapeBorderSourceChanged: { if (artShapeBorderSource !== undefined && artShapeLoader.item) artShapeLoader.item.borderSource = artShapeBorderSource; }
297 readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
298 Item {
299 id: artShapeHolder;
300@@ -30,7 +29,8 @@
301 sourceComponent: Item {
302 id: artShape;
303 objectName: "artShape";
304- property bool doShapeItem: components["art"]["conciergeMode"] !== true;
305+ readonly property bool doShadow: root.artShapeStyle === "shadow";
306+ readonly property bool doShapeItem: components["art"]["conciergeMode"] !== true;
307 visible: image.status == Image.Ready;
308 readonly property alias image: artImage.image;
309 property alias borderSource: artShapeShape.borderSource;
310@@ -48,10 +48,11 @@
311 anchors.fill: parent;
312 visible: doShapeItem;
313 radius: "medium";
314+ borderSource: root.artShapeStyle === "inset" ? "radius_idle.sci" : "none";
315 }
316 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
317 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1;
318- Component.onCompleted: { updateWidthHeightBindings(); if (artShapeBorderSource !== undefined) borderSource = artShapeBorderSource; }
319+ Component.onCompleted: { updateWidthHeightBindings(); }
320 Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); }
321 function updateWidthHeightBindings() {
322 if (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) {
323@@ -70,6 +71,23 @@
324 width: root.width;
325 height: width / artShape.aspect;
326 }
327+ Image {
328+ anchors.centerIn: parent;
329+ source: "shadow.png";
330+ width: parent.width + units.gu(1);
331+ height: parent.height + units.gu(1);
332+ fillMode: Image.PreserveAspectCrop;
333+ visible: doShadow;
334+ z: -1;
335+ }
336+ BorderImage {
337+ anchors.centerIn: parent;
338+ source: "bevel.png";
339+ width: parent.width;
340+ height: parent.height;
341+ visible: doShadow;
342+ z: 1;
343+ }
344 }
345 }
346 }
347@@ -115,7 +133,7 @@
348 id: touchdown;
349 objectName: "touchdown";
350 anchors { fill: artShapeHolder }
351- visible: root.pressed;
352+ visible: root.artShapeStyle != "shadow" && root.pressed;
353 radius: "medium";
354 borderSource: "radius_pressed.sci"
355 }
356
357=== modified file 'tests/plugins/Dash/cardcreator/4.res'
358--- tests/plugins/Dash/cardcreator/4.res 2015-05-13 10:21:18 +0000
359+++ tests/plugins/Dash/cardcreator/4.res 2015-06-25 13:59:12 +0000
360@@ -2,7 +2,7 @@
361 id: root;
362 property var components;
363 property var cardData;
364- property var artShapeBorderSource: undefined;
365+ property string artShapeStyle: "inset";
366 property real fontScale: 1.0;
367 property var scopeStyle: null;
368 property int titleAlignment: Text.AlignLeft;
369@@ -104,7 +104,7 @@
370 id: touchdown;
371 objectName: "touchdown";
372 anchors { fill: root }
373- visible: root.pressed;
374+ visible: root.artShapeStyle != "shadow" && root.pressed;
375 radius: "medium";
376 borderSource: "radius_pressed.sci"
377 }
378
379=== modified file 'tests/plugins/Dash/cardcreator/5.res'
380--- tests/plugins/Dash/cardcreator/5.res 2015-06-16 15:12:28 +0000
381+++ tests/plugins/Dash/cardcreator/5.res 2015-06-25 13:59:12 +0000
382@@ -2,7 +2,7 @@
383 id: root;
384 property var components;
385 property var cardData;
386- property var artShapeBorderSource: undefined;
387+ property string artShapeStyle: "inset";
388 property real fontScale: 1.0;
389 property var scopeStyle: null;
390 property int titleAlignment: Text.AlignLeft;
391@@ -14,7 +14,6 @@
392 implicitWidth: childrenRect.width;
393 enabled: false;
394
395-onArtShapeBorderSourceChanged: { if (artShapeBorderSource !== undefined && artShapeLoader.item) artShapeLoader.item.borderSource = artShapeBorderSource; }
396 readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
397 Item {
398 id: artShapeHolder;
399@@ -30,7 +29,8 @@
400 sourceComponent: Item {
401 id: artShape;
402 objectName: "artShape";
403- property bool doShapeItem: components["art"]["conciergeMode"] !== true;
404+ readonly property bool doShadow: root.artShapeStyle === "shadow";
405+ readonly property bool doShapeItem: components["art"]["conciergeMode"] !== true;
406 visible: image.status == Image.Ready;
407 readonly property alias image: artImage.image;
408 property alias borderSource: artShapeShape.borderSource;
409@@ -48,10 +48,11 @@
410 anchors.fill: parent;
411 visible: doShapeItem;
412 radius: "medium";
413+ borderSource: root.artShapeStyle === "inset" ? "radius_idle.sci" : "none";
414 }
415 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
416 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1;
417- Component.onCompleted: { updateWidthHeightBindings(); if (artShapeBorderSource !== undefined) borderSource = artShapeBorderSource; }
418+ Component.onCompleted: { updateWidthHeightBindings(); }
419 Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); }
420 function updateWidthHeightBindings() {
421 if (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) {
422@@ -70,6 +71,23 @@
423 width: root.width;
424 height: width / artShape.aspect;
425 }
426+ Image {
427+ anchors.centerIn: parent;
428+ source: "shadow.png";
429+ width: parent.width + units.gu(1);
430+ height: parent.height + units.gu(1);
431+ fillMode: Image.PreserveAspectCrop;
432+ visible: doShadow;
433+ z: -1;
434+ }
435+ BorderImage {
436+ anchors.centerIn: parent;
437+ source: "bevel.png";
438+ width: parent.width;
439+ height: parent.height;
440+ visible: doShadow;
441+ z: 1;
442+ }
443 }
444 }
445 }
446@@ -160,7 +178,7 @@
447 id: touchdown;
448 objectName: "touchdown";
449 anchors { fill: artShapeHolder }
450- visible: root.pressed;
451+ visible: root.artShapeStyle != "shadow" && root.pressed;
452 radius: "medium";
453 borderSource: "radius_pressed.sci"
454 }
455
456=== modified file 'tests/plugins/Dash/cardcreator/6.res'
457--- tests/plugins/Dash/cardcreator/6.res 2015-05-13 10:21:18 +0000
458+++ tests/plugins/Dash/cardcreator/6.res 2015-06-25 13:59:12 +0000
459@@ -2,7 +2,7 @@
460 id: root;
461 property var components;
462 property var cardData;
463- property var artShapeBorderSource: undefined;
464+ property string artShapeStyle: "inset";
465 property real fontScale: 1.0;
466 property var scopeStyle: null;
467 property int titleAlignment: Text.AlignLeft;
468@@ -111,7 +111,7 @@
469 id: touchdown;
470 objectName: "touchdown";
471 anchors { fill: backgroundLoader }
472- visible: root.pressed;
473+ visible: root.artShapeStyle != "shadow" && root.pressed;
474 radius: "medium";
475 borderSource: "radius_pressed.sci"
476 }
477
478=== modified file 'tests/plugins/Dash/cardcreator/7.res'
479--- tests/plugins/Dash/cardcreator/7.res 2015-05-13 10:21:18 +0000
480+++ tests/plugins/Dash/cardcreator/7.res 2015-06-25 13:59:12 +0000
481@@ -2,7 +2,7 @@
482 id: root;
483 property var components;
484 property var cardData;
485- property var artShapeBorderSource: undefined;
486+ property string artShapeStyle: "inset";
487 property real fontScale: 1.0;
488 property var scopeStyle: null;
489 property int titleAlignment: Text.AlignLeft;
490@@ -135,7 +135,7 @@
491 id: touchdown;
492 objectName: "touchdown";
493 anchors { fill: backgroundLoader }
494- visible: root.pressed;
495+ visible: root.artShapeStyle != "shadow" && root.pressed;
496 radius: "medium";
497 borderSource: "radius_pressed.sci"
498 }

Subscribers

People subscribed via source and target branches