on xenial help sign in
Add shadows to ubuntu store icon

Approved by: Albert Astals Cid

commitfc437d9478a5a07c7ca9fd2fb797ae97cfaf867c authorAndrea Cimitan <andrea.cimitan@gmail.com> dateTue 8 Dec 2015, 15:36 (11 years ago) parentc7cb6406da7c60
11 files changed+66−9
plugins/Dash/CardCreator.js+9 qml/Dash/CardGrid.qml+2 qml/Dash/GenericScopeView.qml+15−9 tests/plugins/Dash/cardcreator/1.res+1 tests/plugins/Dash/cardcreator/2.res+9 tests/plugins/Dash/cardcreator/3.res+1 tests/plugins/Dash/cardcreator/4.res+1 tests/plugins/Dash/cardcreator/5.res+1 tests/plugins/Dash/cardcreator/6.res+9 tests/plugins/Dash/cardcreator/7.res+9 tests/plugins/Dash/cardcreator/8.res+9
plugins/Dash/CardCreator.js+9
@@ -28,6 +28,14 @@ var kBackgroundLoaderCode = 'Loader {\n\
2828 sourceComponent: UbuntuShape { \n\
2929 objectName: "background"; \n\
3030 radius: "medium"; \n\
31+ aspect: { \n\
32+ switch (root.backgroundShapeStyle) { \n\
33+ case "inset": return UbuntuShape.Inset; \n\
34+ case "shadow": return UbuntuShape.DropShadow; \n\
35+ default: \n\
36+ case "flat": return UbuntuShape.Flat; \n\
37+ } \n\
38+ } \n\
3139 backgroundColor: getColor(0) || "white"; \n\
3240 secondaryBackgroundColor: getColor(1) || backgroundColor; \n\
3341 backgroundMode: UbuntuShape.VerticalGradient; \n\
@@ -318,6 +326,7 @@ function cardString(template, components) {
318326 property var components; \n\
319327 property var cardData; \n\
320328 property string artShapeStyle: "inset"; \n\
329+ property string backgroundShapeStyle: "inset"; \n\
321330 property real fontScale: 1.0; \n\
322331 property var scopeStyle: null; \n\
323332 property int titleAlignment: Text.AlignLeft; \n\
qml/Dash/CardGrid.qml+2
@@ -25,6 +25,7 @@ DashRenderer {
2525 return cardTool.template["collapsed-rows"];
2626 }
2727 property string artShapeStyle: "inset";
28+ property string backgroundShapeStyle: "inset";
2829
2930 expandedHeight: grid.totalContentHeight
3031 collapsedHeight: Math.min(grid.contentHeightForRows(collapsedRows, grid.cellHeight), expandedHeight)
@@ -71,6 +72,7 @@ DashRenderer {
7172 item.titleAlignment = Qt.binding(function() { return cardTool.titleAlignment; });
7273 item.scopeStyle = root.scopeStyle;
7374 item.artShapeStyle = root.artShapeStyle;
75+ item.backgroundShapeStyle = root.backgroundShapeStyle;
7476 }
7577 Connections {
7678 target: loader.item
qml/Dash/GenericScopeView.qml+15−9
@@ -360,17 +360,23 @@ FocusScope {
360360 baseItem.expand(shouldExpand, false /*animate*/);
361361 }
362362 updateRanges();
363− if (scope && scope.id === "clickscope" && (categoryId === "predefined" || categoryId === "local")) {
364− // Yeah, hackish :/
365− if (scopeView.width > units.gu(45)) {
366− if (scopeView.width >= units.gu(70)) {
367− cardTool.cardWidth = units.gu(9);
368− } else {
369− cardTool.cardWidth = units.gu(10);
363+ if (scope && scope.id === "clickscope") {
364+ if (categoryId === "predefined" || categoryId === "local") {
365+ // Yeah, hackish :/
366+ if (scopeView.width > units.gu(45)) {
367+ if (scopeView.width >= units.gu(70)) {
368+ cardTool.cardWidth = units.gu(9);
369+ } else {
370+ cardTool.cardWidth = units.gu(10);
371+ }
370372 }
373+ cardTool.artShapeSize = Qt.size(units.gu(8), units.gu(7.5));
374+ item.artShapeStyle = "icon";
375+ } else {
376+ // Should be ubuntu store icon
377+ item.artShapeStyle = "flat";
378+ item.backgroundShapeStyle = "shadow";
371379 }
372− cardTool.artShapeSize = Qt.size(units.gu(8), units.gu(7.5));
373− item.artShapeStyle = "icon";
374380 }
375381 item.cardTool = cardTool;
376382 }
tests/plugins/Dash/cardcreator/1.res+1
@@ -3,6 +3,7 @@ AbstractButton {
33 property var components;
44 property var cardData;
55 property string artShapeStyle: "inset";
6+ property string backgroundShapeStyle: "inset";
67 property real fontScale: 1.0;
78 property var scopeStyle: null;
89 property int titleAlignment: Text.AlignLeft;
tests/plugins/Dash/cardcreator/2.res+9
@@ -3,6 +3,7 @@ AbstractButton {
33 property var components;
44 property var cardData;
55 property string artShapeStyle: "inset";
6+ property string backgroundShapeStyle: "inset";
67 property real fontScale: 1.0;
78 property var scopeStyle: null;
89 property int titleAlignment: Text.AlignLeft;
@@ -23,6 +24,14 @@ Loader {
2324 sourceComponent: UbuntuShape {
2425 objectName: "background";
2526 radius: "medium";
27+ aspect: {
28+ switch (root.backgroundShapeStyle) {
29+ case "inset": return UbuntuShape.Inset;
30+ case "shadow": return UbuntuShape.DropShadow;
31+ default:
32+ case "flat": return UbuntuShape.Flat;
33+ }
34+ }
2635 backgroundColor: getColor(0) || "white";
2736 secondaryBackgroundColor: getColor(1) || backgroundColor;
2837 backgroundMode: UbuntuShape.VerticalGradient;
tests/plugins/Dash/cardcreator/3.res+1
@@ -3,6 +3,7 @@ AbstractButton {
33 property var components;
44 property var cardData;
55 property string artShapeStyle: "inset";
6+ property string backgroundShapeStyle: "inset";
67 property real fontScale: 1.0;
78 property var scopeStyle: null;
89 property int titleAlignment: Text.AlignLeft;
tests/plugins/Dash/cardcreator/4.res+1
@@ -3,6 +3,7 @@ AbstractButton {
33 property var components;
44 property var cardData;
55 property string artShapeStyle: "inset";
6+ property string backgroundShapeStyle: "inset";
67 property real fontScale: 1.0;
78 property var scopeStyle: null;
89 property int titleAlignment: Text.AlignLeft;
tests/plugins/Dash/cardcreator/5.res+1
@@ -3,6 +3,7 @@ AbstractButton {
33 property var components;
44 property var cardData;
55 property string artShapeStyle: "inset";
6+ property string backgroundShapeStyle: "inset";
67 property real fontScale: 1.0;
78 property var scopeStyle: null;
89 property int titleAlignment: Text.AlignLeft;
tests/plugins/Dash/cardcreator/6.res+9
@@ -3,6 +3,7 @@ AbstractButton {
33 property var components;
44 property var cardData;
55 property string artShapeStyle: "inset";
6+ property string backgroundShapeStyle: "inset";
67 property real fontScale: 1.0;
78 property var scopeStyle: null;
89 property int titleAlignment: Text.AlignLeft;
@@ -23,6 +24,14 @@ Loader {
2324 sourceComponent: UbuntuShape {
2425 objectName: "background";
2526 radius: "medium";
27+ aspect: {
28+ switch (root.backgroundShapeStyle) {
29+ case "inset": return UbuntuShape.Inset;
30+ case "shadow": return UbuntuShape.DropShadow;
31+ default:
32+ case "flat": return UbuntuShape.Flat;
33+ }
34+ }
2635 backgroundColor: getColor(0) || "white";
2736 secondaryBackgroundColor: getColor(1) || backgroundColor;
2837 backgroundMode: UbuntuShape.VerticalGradient;
tests/plugins/Dash/cardcreator/7.res+9
@@ -3,6 +3,7 @@ AbstractButton {
33 property var components;
44 property var cardData;
55 property string artShapeStyle: "inset";
6+ property string backgroundShapeStyle: "inset";
67 property real fontScale: 1.0;
78 property var scopeStyle: null;
89 property int titleAlignment: Text.AlignLeft;
@@ -23,6 +24,14 @@ Loader {
2324 sourceComponent: UbuntuShape {
2425 objectName: "background";
2526 radius: "medium";
27+ aspect: {
28+ switch (root.backgroundShapeStyle) {
29+ case "inset": return UbuntuShape.Inset;
30+ case "shadow": return UbuntuShape.DropShadow;
31+ default:
32+ case "flat": return UbuntuShape.Flat;
33+ }
34+ }
2635 backgroundColor: getColor(0) || "white";
2736 secondaryBackgroundColor: getColor(1) || backgroundColor;
2837 backgroundMode: UbuntuShape.VerticalGradient;
tests/plugins/Dash/cardcreator/8.res+9
@@ -3,6 +3,7 @@ AbstractButton {
33 property var components;
44 property var cardData;
55 property string artShapeStyle: "inset";
6+ property string backgroundShapeStyle: "inset";
67 property real fontScale: 1.0;
78 property var scopeStyle: null;
89 property int titleAlignment: Text.AlignLeft;
@@ -23,6 +24,14 @@ Loader {
2324 sourceComponent: UbuntuShape {
2425 objectName: "background";
2526 radius: "medium";
27+ aspect: {
28+ switch (root.backgroundShapeStyle) {
29+ case "inset": return UbuntuShape.Inset;
30+ case "shadow": return UbuntuShape.DropShadow;
31+ default:
32+ case "flat": return UbuntuShape.Flat;
33+ }
34+ }
2635 backgroundColor: getColor(0) || "white";
2736 secondaryBackgroundColor: getColor(1) || backgroundColor;
2837 backgroundMode: UbuntuShape.VerticalGradient;