on xenial help sign in
merged lp:~cimi/unity8/cardCreatorCache_update-on-artShapeStyle
c66370cAndrea Cimitan
plugins/Dash/CardCreatorCache.qml+1−1
@@ -29,7 +29,7 @@ QtObject {
29
29
30 var tString = JSON.stringify(template);
30 var tString = JSON.stringify(template);
31 var cString = JSON.stringify(components);
31 var cString = JSON.stringify(components);
32− var allString = tString + cString + isCardTool;
32+ var allString = tString + cString + isCardTool + artShapeStyle;
33 var component = cache[allString];
33 var component = cache[allString];
34 if (component === undefined) {
34 if (component === undefined) {
35 component = CardCreator.createCardComponent(root, template, components, isCardTool, artShapeStyle, allString);
35 component = CardCreator.createCardComponent(root, template, components, isCardTool, artShapeStyle, allString);
qml/Dash/CardTool.qml+2−2
@@ -70,7 +70,7 @@ Item {
70 // Not readonly because gets overwritten from GenericScopeView in some cases
70 // Not readonly because gets overwritten from GenericScopeView in some cases
71 property string artShapeStyle: categoryLayout === "carousel" ? "shadow" : "inset"
71 property string artShapeStyle: categoryLayout === "carousel" ? "shadow" : "inset"
72
72
73− property var cardComponent: CardCreatorCache.getCardComponent(cardTool.template, cardTool.components, false, artShapeStyle);
73+ property var cardComponent: CardCreatorCache.getCardComponent(cardTool.template, cardTool.components, false, cardTool.artShapeStyle);
74
74
75 // FIXME: Saviq
75 // FIXME: Saviq
76 // Only way for the card below to actually be laid out completely.
76 // Only way for the card below to actually be laid out completely.
@@ -212,7 +212,7 @@ Item {
212 "attributes": attributesModel.model,
212 "attributes": attributesModel.model,
213 "socialActions": socialActionsModel.model
213 "socialActions": socialActionsModel.model
214 }
214 }
215− sourceComponent: CardCreatorCache.getCardComponent(cardTool.template, cardTool.components, true, artShapeStyle);
215+ sourceComponent: CardCreatorCache.getCardComponent(cardTool.template, cardTool.components, true, cardTool.artShapeStyle);
216 onLoaded: {
216 onLoaded: {
217 item.objectName = "cardToolCard";
217 item.objectName = "cardToolCard";
218 item.width = Qt.binding(function() { return cardTool.cardWidth !== -1 ? cardTool.cardWidth : item.implicitWidth; });
218 item.width = Qt.binding(function() { return cardTool.cardWidth !== -1 ? cardTool.cardWidth : item.implicitWidth; });
tests/qmltests/Dash/tst_Dash.qml+18−1
@@ -88,7 +88,7 @@ Item {
88 return findChild(genericScopeView, categoryName);
88 return findChild(genericScopeView, categoryName);
89 }
89 }
90
90
91− function clickCategoryDelegate(category, delegate) {
91+ function getCategoryDelegate(category, delegate) {
92 var dashContentList = findChild(dash, "dashContentList");
92 var dashContentList = findChild(dash, "dashContentList");
93 var genericScopeView = dashContentList.currentItem;
93 var genericScopeView = dashContentList.currentItem;
94 if (category === undefined) category = 0;
94 if (category === undefined) category = 0;
@@ -104,6 +104,11 @@ Item {
104 true);
104 true);
105 var tile = findChild(findChild(genericScopeView, "dashCategory"+category), "delegate"+delegate);
105 var tile = findChild(findChild(genericScopeView, "dashCategory"+category), "delegate"+delegate);
106 waitForRendering(tile);
106 waitForRendering(tile);
107+ return tile;
108+ }
109+
110+ function clickCategoryDelegate(category, delegate) {
111+ var tile = getCategoryDelegate(category, delegate);
107 mouseClick(tile);
112 mouseClick(tile);
108 }
113 }
109
114
@@ -637,6 +642,18 @@ Item {
637 tryCompare(dashContent, "x", 0);
642 tryCompare(dashContent, "x", 0);
638 }
643 }
639
644
645+ function test_cardIconStyle()
646+ {
647+ dash.setCurrentScope("clickscope");
648+ var dashContent = findChild(dash, "dashContent");
649+ tryCompare(dashContent.currentScope, "id", "clickscope");
650+
651+ scrollToCategory("dashCategorypredefined");
652+ var tile = getCategoryDelegate("predefined", 2);
653+ var proportionalShape = findChildsByType(tile, "UCProportionalShape");
654+ compare(proportionalShape.length, 1);
655+ }
656+
640 function test_tempScopeItemXOnResize()
657 function test_tempScopeItemXOnResize()
641 {
658 {
642 // Go to a temp scope
659 // Go to a temp scope