on xenial help sign in
Fixed tests
ba394b6Andrea Cimitan
plugins/Dash/CardCreator.js+6−4
@@ -153,7 +153,7 @@ var kHeaderRowCodeTemplate = 'Row { \n\
153 anchors { %1 } \n\
153 anchors { %1 } \n\
154 anchors.right: parent.right; \n\
154 anchors.right: parent.right; \n\
155 anchors.margins: margins; \n\
155 anchors.margins: margins; \n\
156− anchors.rightMargin: units.gu(0); \n\
156+ anchors.rightMargin: 0; \n\
157 data: [ \n\
157 data: [ \n\
158 %2 \n\
158 %2 \n\
159 ] \n\
159 ] \n\
@@ -459,8 +459,8 @@ function cardString(template, components) {
459 var titleAnchors;
459 var titleAnchors;
460 var subtitleAnchors;
460 var subtitleAnchors;
461 var attributesAnchors;
461 var attributesAnchors;
462− var titleRightAnchor;
463 var titleContainerAnchors;
462 var titleContainerAnchors;
463+ var titleRightAnchor;
464
464
465 // GOOD LUCK!
465 // GOOD LUCK!
466
466
@@ -475,9 +475,11 @@ function cardString(template, components) {
475 }
475 }
476 }
476 }
477 if (hasEmblem) {
477 if (hasEmblem) {
478− titleRightAnchor = 'right: emblemImage.left;\n';
478+ titleRightAnchor = 'right: emblemImage.left; \n\
479+ rightMargin: units.gu(0.5); \n';
479 } else {
480 } else {
480− titleRightAnchor = 'right: parent.right;\n';
481+ titleRightAnchor = 'right: parent.right; \n\
482+ rightMargin: units.gu(1); \n';
481 }
483 }
482
484
483 if (hasEmblem || (hasMascot && (hasSubtitle || hasAttributes))) {
485 if (hasEmblem || (hasMascot && (hasSubtitle || hasAttributes))) {
tests/plugins/Dash/cardcreator/1.res+6−6
@@ -67,12 +67,12 @@ Label {
67 id: titleLabel;
67 id: titleLabel;
68 objectName: "titleLabel";
68 objectName: "titleLabel";
69 anchors { right: parent.right;
69 anchors { right: parent.right;
70−rightMargin: units.gu(1);
70+ rightMargin: units.gu(1);
71−left: parent.left;
71+ left: parent.left;
72−top: artShapeHolder.bottom;
72+ top: artShapeHolder.bottom;
73− topMargin: units.gu(1);
73+ topMargin: units.gu(1);
74−leftMargin: units.gu(1);
74+ leftMargin: units.gu(1);
75− }
75+ }
76 elide: Text.ElideRight;
76 elide: Text.ElideRight;
77 fontSize: "small";
77 fontSize: "small";
78 wrapMode: Text.Wrap;
78 wrapMode: Text.Wrap;
tests/plugins/Dash/cardcreator/2.res+24−20
@@ -55,12 +55,14 @@ Row {
55 spacing: margins;
55 spacing: margins;
56 height: root.fixedHeaderHeight != -1 ? root.fixedHeaderHeight : implicitHeight;
56 height: root.fixedHeaderHeight != -1 ? root.fixedHeaderHeight : implicitHeight;
57 anchors { top: parent.top;
57 anchors { top: parent.top;
58− topMargin: units.gu(1);
58+ topMargin: units.gu(1);
59−left: parent.left;
59+ left: parent.left;
60− }
60+ }
61 anchors.right: parent.right;
61 anchors.right: parent.right;
62 anchors.margins: margins;
62 anchors.margins: margins;
63+ anchors.rightMargin: 0;
64+ data: [
63− data: [ Image {
65+Image {
64 id: mascotImage;
66 id: mascotImage;
65 objectName: "mascotImage";
67 objectName: "mascotImage";
66 anchors { verticalCenter: parent.verticalCenter; }
68 anchors { verticalCenter: parent.verticalCenter; }
@@ -74,16 +76,19 @@ left: parent.left;
74 verticalAlignment: Image.AlignVCenter;
76 verticalAlignment: Image.AlignVCenter;
75 visible: showHeader;
77 visible: showHeader;
76 }
78 }
77−
79+,Item {
78− ,
80+ id: headerTitleContainer;
79− Column {
80− anchors.verticalCenter: parent.verticalCenter;
81+ anchors { verticalCenter: parent.verticalCenter; }
81− spacing: units.dp(2);
82− width: parent.width - x;
82+ width: parent.width - x;
83+ implicitHeight: titleLabel.height + subtitleLabel.height;
84+ data: [
83− data: [ Label {
85+ Label {
84 id: titleLabel;
86 id: titleLabel;
85 objectName: "titleLabel";
87 objectName: "titleLabel";
88+ anchors { right: parent.right;
89+ rightMargin: units.gu(1);
86− anchors { left: parent.left; right: parent.right }
90+ left: parent.left;
91+ top: parent.top; }
87 elide: Text.ElideRight;
92 elide: Text.ElideRight;
88 fontSize: "small";
93 fontSize: "small";
89 wrapMode: Text.Wrap;
94 wrapMode: Text.Wrap;
@@ -95,16 +100,15 @@ left: parent.left;
95 font.weight: components && components["subtitle"] ? Font.DemiBold : Font.Normal;
100 font.weight: components && components["subtitle"] ? Font.DemiBold : Font.Normal;
96 horizontalAlignment: root.headerAlignment;
101 horizontalAlignment: root.headerAlignment;
97 }
102 }
98−]
99−}
100−]
101−}
102−
103− ,
104− Label {
103+ ,Label {
105 id: subtitleLabel;
104 id: subtitleLabel;
106 objectName: "subtitleLabel";
105 objectName: "subtitleLabel";
106+ anchors { right: parent.right;
107− anchors { left: parent.left; right: parent.right }
107+ left: parent.left;
108+ rightMargin: units.gu(1);
109+ top: titleLabel.bottom;
110+ }
111+ anchors.topMargin: units.dp(2);
108 elide: Text.ElideRight;
112 elide: Text.ElideRight;
109 fontSize: "small";
113 fontSize: "small";
110 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale);
114 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale);
tests/plugins/Dash/cardcreator/3.res+12−12
@@ -67,12 +67,12 @@ Label {
67 id: titleLabel;
67 id: titleLabel;
68 objectName: "titleLabel";
68 objectName: "titleLabel";
69 anchors { right: parent.right;
69 anchors { right: parent.right;
70−rightMargin: units.gu(1);
70+ rightMargin: units.gu(1);
71−left: parent.left;
71+ left: parent.left;
72−top: artShapeHolder.bottom;
72+ top: artShapeHolder.bottom;
73− topMargin: units.gu(1);
73+ topMargin: units.gu(1);
74−leftMargin: units.gu(1);
74+ leftMargin: units.gu(1);
75− }
75+ }
76 elide: Text.ElideRight;
76 elide: Text.ElideRight;
77 fontSize: "small";
77 fontSize: "small";
78 wrapMode: Text.Wrap;
78 wrapMode: Text.Wrap;
@@ -88,12 +88,12 @@ Label {
88 id: subtitleLabel;
88 id: subtitleLabel;
89 objectName: "subtitleLabel";
89 objectName: "subtitleLabel";
90 anchors { left: titleLabel.left;
90 anchors { left: titleLabel.left;
91− leftMargin: titleLabel.leftMargin;
91+ leftMargin: titleLabel.leftMargin;
92− right: titleLabel.right;
92+ rightMargin: units.gu(1);
93− rightMargin: titleLabel.rightMargin;
93+ right: titleLabel.right;
94− top: titleLabel.bottom;
94+ top: titleLabel.bottom;
95+ }
95− topMargin: units.dp(2);
96+ anchors.topMargin: units.dp(2);
96− }
97 elide: Text.ElideRight;
97 elide: Text.ElideRight;
98 fontSize: "small";
98 fontSize: "small";
99 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale);
99 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale);
tests/plugins/Dash/cardcreator/4.res+22−14
@@ -27,7 +27,9 @@ Row {
27}
27}
28 anchors.right: parent.right;
28 anchors.right: parent.right;
29 anchors.margins: margins;
29 anchors.margins: margins;
30+ anchors.rightMargin: 0;
31+data: [
30−data: [ Loader {
32+Loader {
31 id: mascotShapeLoader;
33 id: mascotShapeLoader;
32 objectName: "mascotShapeLoader";
34 objectName: "mascotShapeLoader";
33 asynchronous: root.asynchronous;
35 asynchronous: root.asynchronous;
@@ -39,8 +41,7 @@ data: [ Loader {
39 anchors { verticalCenter: parent.verticalCenter; }
41 anchors { verticalCenter: parent.verticalCenter; }
40 }
42 }
41
43
42−,
43−Image {
44+,Image {
44 id: mascotImage;
45 id: mascotImage;
45 objectName: "mascotImage";
46 objectName: "mascotImage";
46 anchors { verticalCenter: parent.verticalCenter; }
47 anchors { verticalCenter: parent.verticalCenter; }
@@ -55,15 +56,19 @@ Image {
55 visible: false;
56 visible: false;
56 }
57 }
57
58
58−,
59+,Item {
59−Column {
60+ id: headerTitleContainer;
60− anchors.verticalCenter: parent.verticalCenter;
61+ anchors { verticalCenter: parent.verticalCenter; }
61− spacing: units.dp(2);
62− width: parent.width - x;
62+ width: parent.width - x;
63+ implicitHeight: titleLabel.height + subtitleLabel.height;
64+ data: [
63−data: [ Label {
65+Label {
64 id: titleLabel;
66 id: titleLabel;
65 objectName: "titleLabel";
67 objectName: "titleLabel";
68+ anchors { right: parent.right;
69+ rightMargin: units.gu(1);
66− anchors { left: parent.left; right: parent.right }
70+ left: parent.left;
71+ top: parent.top; }
67 elide: Text.ElideRight;
72 elide: Text.ElideRight;
68 fontSize: "small";
73 fontSize: "small";
69 wrapMode: Text.Wrap;
74 wrapMode: Text.Wrap;
@@ -75,12 +80,15 @@ data: [ Label {
75 font.weight: components && components["subtitle"] ? Font.DemiBold : Font.Normal;
80 font.weight: components && components["subtitle"] ? Font.DemiBold : Font.Normal;
76 horizontalAlignment: root.headerAlignment;
81 horizontalAlignment: root.headerAlignment;
77 }
82 }
78−,
79−Label {
83+,Label {
80 id: subtitleLabel;
84 id: subtitleLabel;
81 objectName: "subtitleLabel";
85 objectName: "subtitleLabel";
86+ anchors { right: parent.right;
82− anchors { left: parent.left; right: parent.right }
87+ left: parent.left;
83−
88+ rightMargin: units.gu(1);
89+ top: titleLabel.bottom;
90+ }
91+ anchors.topMargin: units.dp(2);
84 elide: Text.ElideRight;
92 elide: Text.ElideRight;
85 fontSize: "small";
93 fontSize: "small";
86 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale);
94 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale);
tests/plugins/Dash/cardcreator/5.res+13−13
@@ -106,13 +106,13 @@ readonly property int headerHeight: titleLabel.height + subtitleLabel.height + s
106Label {
106Label {
107 id: titleLabel;
107 id: titleLabel;
108 objectName: "titleLabel";
108 objectName: "titleLabel";
109− anchors { left: parent.left;
110− leftMargin: units.gu(1);
111− right: parent.right;
109+ anchors { right: parent.right;
112− rightMargin: units.gu(1);
110+ rightMargin: units.gu(1);
111+ left: parent.left;
112+ leftMargin: units.gu(1);
113− top: overlayLoader.top;
113+ top: overlayLoader.top;
114− topMargin: units.gu(1);
114+ topMargin: units.gu(1);
115− }
115+ }
116 elide: Text.ElideRight;
116 elide: Text.ElideRight;
117 fontSize: "small";
117 fontSize: "small";
118 wrapMode: Text.Wrap;
118 wrapMode: Text.Wrap;
@@ -128,12 +128,12 @@ Label {
128 id: subtitleLabel;
128 id: subtitleLabel;
129 objectName: "subtitleLabel";
129 objectName: "subtitleLabel";
130 anchors { left: titleLabel.left;
130 anchors { left: titleLabel.left;
131− leftMargin: titleLabel.leftMargin;
131+ leftMargin: titleLabel.leftMargin;
132− right: titleLabel.right;
132+ rightMargin: units.gu(1);
133− rightMargin: titleLabel.rightMargin;
133+ right: titleLabel.right;
134− top: titleLabel.bottom;
134+ top: titleLabel.bottom;
135+ }
135− topMargin: units.dp(2);
136+ anchors.topMargin: units.dp(2);
136− }
137 elide: Text.ElideRight;
137 elide: Text.ElideRight;
138 fontSize: "small";
138 fontSize: "small";
139 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale);
139 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale);
tests/plugins/Dash/cardcreator/7.res+30−18
@@ -55,12 +55,14 @@ Row {
55 spacing: margins;
55 spacing: margins;
56 height: root.fixedHeaderHeight != -1 ? root.fixedHeaderHeight : implicitHeight;
56 height: root.fixedHeaderHeight != -1 ? root.fixedHeaderHeight : implicitHeight;
57 anchors { top: parent.top;
57 anchors { top: parent.top;
58− topMargin: units.gu(1);
58+ topMargin: units.gu(1);
59−left: parent.left;
59+ left: parent.left;
60− }
60+ }
61 anchors.right: parent.right;
61 anchors.right: parent.right;
62 anchors.margins: margins;
62 anchors.margins: margins;
63+ anchors.rightMargin: 0;
64+ data: [
63− data: [ Image {
65+Image {
64 id: mascotImage;
66 id: mascotImage;
65 objectName: "mascotImage";
67 objectName: "mascotImage";
66 anchors { verticalCenter: parent.verticalCenter; }
68 anchors { verticalCenter: parent.verticalCenter; }
@@ -75,16 +77,19 @@ left: parent.left;
75 visible: showHeader;
77 visible: showHeader;
76 }
78 }
77
79
78− ,
80+,Item {
79− Column {
81+ id: headerTitleContainer;
80− anchors.verticalCenter: parent.verticalCenter;
82+ anchors { verticalCenter: parent.verticalCenter; }
81− spacing: units.dp(2);
82− width: parent.width - x;
83+ width: parent.width - x;
84+ implicitHeight: titleLabel.height + subtitleLabel.height + attributesRow.height;
83− data: [
85+ data: [
84− Label {
86+ Label {
85 id: titleLabel;
87 id: titleLabel;
86 objectName: "titleLabel";
88 objectName: "titleLabel";
89+ anchors { right: parent.right;
90+ rightMargin: units.gu(1);
87− anchors { left: parent.left; right: parent.right }
91+ left: parent.left;
92+ top: parent.top; }
88 elide: Text.ElideRight;
93 elide: Text.ElideRight;
89 fontSize: "small";
94 fontSize: "small";
90 wrapMode: Text.Wrap;
95 wrapMode: Text.Wrap;
@@ -96,11 +101,15 @@ left: parent.left;
96 font.weight: components && components["subtitle"] ? Font.DemiBold : Font.Normal;
101 font.weight: components && components["subtitle"] ? Font.DemiBold : Font.Normal;
97 horizontalAlignment: root.headerAlignment;
102 horizontalAlignment: root.headerAlignment;
98 }
103 }
99−,
100−Label {
104+,Label {
101 id: subtitleLabel;
105 id: subtitleLabel;
102 objectName: "subtitleLabel";
106 objectName: "subtitleLabel";
107+ anchors { right: parent.right;
103− anchors { left: parent.left; right: parent.right }
108+ left: parent.left;
109+ rightMargin: units.gu(1);
110+ top: titleLabel.bottom;
111+ }
112+ anchors.topMargin: units.dp(2);
104 elide: Text.ElideRight;
113 elide: Text.ElideRight;
105 fontSize: "small";
114 fontSize: "small";
106 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale);
115 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale);
@@ -110,11 +119,14 @@ Label {
110 font.weight: Font.Light;
119 font.weight: Font.Light;
111 horizontalAlignment: root.headerAlignment;
120 horizontalAlignment: root.headerAlignment;
112 }
121 }
113−,
114−CardAttributes {
122+,CardAttributes {
115 id: attributesRow;
123 id: attributesRow;
116 objectName: "attributesRow";
124 objectName: "attributesRow";
125+ anchors { right: parent.right;
117− anchors { left: parent.left; right: parent.right }
126+ left: parent.left;
127+ rightMargin: units.gu(1);
128+ top: subtitleLabel.bottom;
129+ }
118 color: backgroundLoader.active && backgroundLoader.item && backgroundLoader.item.luminance < 0.7 ? "white" : (root.scopeStyle ? root.scopeStyle.foreground : "grey");
130 color: backgroundLoader.active && backgroundLoader.item && backgroundLoader.item.luminance < 0.7 ? "white" : (root.scopeStyle ? root.scopeStyle.foreground : "grey");
119 model: cardData["attributes"];
131 model: cardData["attributes"];
120 }
132 }