on xenial help sign in
Add shadows to ubuntu store icon
fc437d9Andrea Cimitan
plugins/Dash/CardCreator.js+9
@@ -28,6 +28,14 @@ var kBackgroundLoaderCode = 'Loader {\n\
28 sourceComponent: UbuntuShape { \n\
28 sourceComponent: UbuntuShape { \n\
29 objectName: "background"; \n\
29 objectName: "background"; \n\
30 radius: "medium"; \n\
30 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\
31 backgroundColor: getColor(0) || "white"; \n\
39 backgroundColor: getColor(0) || "white"; \n\
32 secondaryBackgroundColor: getColor(1) || backgroundColor; \n\
40 secondaryBackgroundColor: getColor(1) || backgroundColor; \n\
33 backgroundMode: UbuntuShape.VerticalGradient; \n\
41 backgroundMode: UbuntuShape.VerticalGradient; \n\
@@ -318,6 +326,7 @@ function cardString(template, components) {
318 property var components; \n\
326 property var components; \n\
319 property var cardData; \n\
327 property var cardData; \n\
320 property string artShapeStyle: "inset"; \n\
328 property string artShapeStyle: "inset"; \n\
329+ property string backgroundShapeStyle: "inset"; \n\
321 property real fontScale: 1.0; \n\
330 property real fontScale: 1.0; \n\
322 property var scopeStyle: null; \n\
331 property var scopeStyle: null; \n\
323 property int titleAlignment: Text.AlignLeft; \n\
332 property int titleAlignment: Text.AlignLeft; \n\
qml/Dash/CardGrid.qml+2
@@ -25,6 +25,7 @@ DashRenderer {
25 return cardTool.template["collapsed-rows"];
25 return cardTool.template["collapsed-rows"];
26 }
26 }
27 property string artShapeStyle: "inset";
27 property string artShapeStyle: "inset";
28+ property string backgroundShapeStyle: "inset";
28
29
29 expandedHeight: grid.totalContentHeight
30 expandedHeight: grid.totalContentHeight
30 collapsedHeight: Math.min(grid.contentHeightForRows(collapsedRows, grid.cellHeight), expandedHeight)
31 collapsedHeight: Math.min(grid.contentHeightForRows(collapsedRows, grid.cellHeight), expandedHeight)
@@ -71,6 +72,7 @@ DashRenderer {
71 item.titleAlignment = Qt.binding(function() { return cardTool.titleAlignment; });
72 item.titleAlignment = Qt.binding(function() { return cardTool.titleAlignment; });
72 item.scopeStyle = root.scopeStyle;
73 item.scopeStyle = root.scopeStyle;
73 item.artShapeStyle = root.artShapeStyle;
74 item.artShapeStyle = root.artShapeStyle;
75+ item.backgroundShapeStyle = root.backgroundShapeStyle;
74 }
76 }
75 Connections {
77 Connections {
76 target: loader.item
78 target: loader.item
qml/Dash/GenericScopeView.qml+15−9
@@ -360,17 +360,23 @@ FocusScope {
360 baseItem.expand(shouldExpand, false /*animate*/);
360 baseItem.expand(shouldExpand, false /*animate*/);
361 }
361 }
362 updateRanges();
362 updateRanges();
363+ if (scope && scope.id === "clickscope") {
363− if (scope && scope.id === "clickscope" && (categoryId === "predefined" || categoryId === "local")) {
364+ if (categoryId === "predefined" || categoryId === "local") {
364− // Yeah, hackish :/
365+ // Yeah, hackish :/
365− if (scopeView.width > units.gu(45)) {
366+ if (scopeView.width > units.gu(45)) {
366− if (scopeView.width >= units.gu(70)) {
367+ if (scopeView.width >= units.gu(70)) {
367− cardTool.cardWidth = units.gu(9);
368+ cardTool.cardWidth = units.gu(9);
368− } else {
369+ } else {
369− cardTool.cardWidth = units.gu(10);
370+ cardTool.cardWidth = units.gu(10);
371+ }
370 }
372 }
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";
371 }
379 }
372− cardTool.artShapeSize = Qt.size(units.gu(8), units.gu(7.5));
373− item.artShapeStyle = "icon";
374 }
380 }
375 item.cardTool = cardTool;
381 item.cardTool = cardTool;
376 }
382 }
tests/plugins/Dash/cardcreator/1.res+1
@@ -3,6 +3,7 @@ AbstractButton {
3 property var components;
3 property var components;
4 property var cardData;
4 property var cardData;
5 property string artShapeStyle: "inset";
5 property string artShapeStyle: "inset";
6+ property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0;
7 property real fontScale: 1.0;
7 property var scopeStyle: null;
8 property var scopeStyle: null;
8 property int titleAlignment: Text.AlignLeft;
9 property int titleAlignment: Text.AlignLeft;
tests/plugins/Dash/cardcreator/2.res+9
@@ -3,6 +3,7 @@ AbstractButton {
3 property var components;
3 property var components;
4 property var cardData;
4 property var cardData;
5 property string artShapeStyle: "inset";
5 property string artShapeStyle: "inset";
6+ property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0;
7 property real fontScale: 1.0;
7 property var scopeStyle: null;
8 property var scopeStyle: null;
8 property int titleAlignment: Text.AlignLeft;
9 property int titleAlignment: Text.AlignLeft;
@@ -23,6 +24,14 @@ Loader {
23 sourceComponent: UbuntuShape {
24 sourceComponent: UbuntuShape {
24 objectName: "background";
25 objectName: "background";
25 radius: "medium";
26 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+ }
26 backgroundColor: getColor(0) || "white";
35 backgroundColor: getColor(0) || "white";
27 secondaryBackgroundColor: getColor(1) || backgroundColor;
36 secondaryBackgroundColor: getColor(1) || backgroundColor;
28 backgroundMode: UbuntuShape.VerticalGradient;
37 backgroundMode: UbuntuShape.VerticalGradient;
tests/plugins/Dash/cardcreator/3.res+1
@@ -3,6 +3,7 @@ AbstractButton {
3 property var components;
3 property var components;
4 property var cardData;
4 property var cardData;
5 property string artShapeStyle: "inset";
5 property string artShapeStyle: "inset";
6+ property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0;
7 property real fontScale: 1.0;
7 property var scopeStyle: null;
8 property var scopeStyle: null;
8 property int titleAlignment: Text.AlignLeft;
9 property int titleAlignment: Text.AlignLeft;
tests/plugins/Dash/cardcreator/4.res+1
@@ -3,6 +3,7 @@ AbstractButton {
3 property var components;
3 property var components;
4 property var cardData;
4 property var cardData;
5 property string artShapeStyle: "inset";
5 property string artShapeStyle: "inset";
6+ property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0;
7 property real fontScale: 1.0;
7 property var scopeStyle: null;
8 property var scopeStyle: null;
8 property int titleAlignment: Text.AlignLeft;
9 property int titleAlignment: Text.AlignLeft;
tests/plugins/Dash/cardcreator/5.res+1
@@ -3,6 +3,7 @@ AbstractButton {
3 property var components;
3 property var components;
4 property var cardData;
4 property var cardData;
5 property string artShapeStyle: "inset";
5 property string artShapeStyle: "inset";
6+ property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0;
7 property real fontScale: 1.0;
7 property var scopeStyle: null;
8 property var scopeStyle: null;
8 property int titleAlignment: Text.AlignLeft;
9 property int titleAlignment: Text.AlignLeft;
tests/plugins/Dash/cardcreator/6.res+9
@@ -3,6 +3,7 @@ AbstractButton {
3 property var components;
3 property var components;
4 property var cardData;
4 property var cardData;
5 property string artShapeStyle: "inset";
5 property string artShapeStyle: "inset";
6+ property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0;
7 property real fontScale: 1.0;
7 property var scopeStyle: null;
8 property var scopeStyle: null;
8 property int titleAlignment: Text.AlignLeft;
9 property int titleAlignment: Text.AlignLeft;
@@ -23,6 +24,14 @@ Loader {
23 sourceComponent: UbuntuShape {
24 sourceComponent: UbuntuShape {
24 objectName: "background";
25 objectName: "background";
25 radius: "medium";
26 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+ }
26 backgroundColor: getColor(0) || "white";
35 backgroundColor: getColor(0) || "white";
27 secondaryBackgroundColor: getColor(1) || backgroundColor;
36 secondaryBackgroundColor: getColor(1) || backgroundColor;
28 backgroundMode: UbuntuShape.VerticalGradient;
37 backgroundMode: UbuntuShape.VerticalGradient;
tests/plugins/Dash/cardcreator/7.res+9
@@ -3,6 +3,7 @@ AbstractButton {
3 property var components;
3 property var components;
4 property var cardData;
4 property var cardData;
5 property string artShapeStyle: "inset";
5 property string artShapeStyle: "inset";
6+ property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0;
7 property real fontScale: 1.0;
7 property var scopeStyle: null;
8 property var scopeStyle: null;
8 property int titleAlignment: Text.AlignLeft;
9 property int titleAlignment: Text.AlignLeft;
@@ -23,6 +24,14 @@ Loader {
23 sourceComponent: UbuntuShape {
24 sourceComponent: UbuntuShape {
24 objectName: "background";
25 objectName: "background";
25 radius: "medium";
26 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+ }
26 backgroundColor: getColor(0) || "white";
35 backgroundColor: getColor(0) || "white";
27 secondaryBackgroundColor: getColor(1) || backgroundColor;
36 secondaryBackgroundColor: getColor(1) || backgroundColor;
28 backgroundMode: UbuntuShape.VerticalGradient;
37 backgroundMode: UbuntuShape.VerticalGradient;
tests/plugins/Dash/cardcreator/8.res+9
@@ -3,6 +3,7 @@ AbstractButton {
3 property var components;
3 property var components;
4 property var cardData;
4 property var cardData;
5 property string artShapeStyle: "inset";
5 property string artShapeStyle: "inset";
6+ property string backgroundShapeStyle: "inset";
6 property real fontScale: 1.0;
7 property real fontScale: 1.0;
7 property var scopeStyle: null;
8 property var scopeStyle: null;
8 property int titleAlignment: Text.AlignLeft;
9 property int titleAlignment: Text.AlignLeft;
@@ -23,6 +24,14 @@ Loader {
23 sourceComponent: UbuntuShape {
24 sourceComponent: UbuntuShape {
24 objectName: "background";
25 objectName: "background";
25 radius: "medium";
26 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+ }
26 backgroundColor: getColor(0) || "white";
35 backgroundColor: getColor(0) || "white";
27 secondaryBackgroundColor: getColor(1) || backgroundColor;
36 secondaryBackgroundColor: getColor(1) || backgroundColor;
28 backgroundMode: UbuntuShape.VerticalGradient;
37 backgroundMode: UbuntuShape.VerticalGradient;