on xenial help sign in
some fixes here and there
434f5eaAlbert Astals
qml/Dash/CardCreator.js+12−5
@@ -139,6 +139,8 @@ function createCardComponent(parent, template, components) {
139 } \
139 } \
140 } \
140 } \
141 }'
141 }'
142+ } else {
143+ code += 'readonly property size artShapeSize: Qt.size(-1, -1);'
142 }
144 }
143
145
144 if (inOverlay) {
146 if (inOverlay) {
@@ -199,8 +201,13 @@ function createCardComponent(parent, template, components) {
199 headerVerticalAnchors = 'anchors.bottom: artShapeHolder.bottom; \
201 headerVerticalAnchors = 'anchors.bottom: artShapeHolder.bottom; \
200 anchors.bottomMargin: units.gu(1);';
202 anchors.bottomMargin: units.gu(1);';
201 } else {
203 } else {
204+ if (hasArt) {
202− headerVerticalAnchors = 'anchors.top: artShapeHolder.bottom; \
205+ headerVerticalAnchors = 'anchors.top: artShapeHolder.bottom; \
206+ anchors.topMargin: units.gu(1);';
207+ } else {
208+ headerVerticalAnchors = 'anchors.top: parent.top; \
203− anchors.topMargin: units.gu(1);';
209+ anchors.topMargin: units.gu(1);';
210+ }
204 }
211 }
205 }
212 }
206
213
@@ -265,8 +272,7 @@ function createCardComponent(parent, template, components) {
265 anchors += 'anchors.left: mascotImage.right; \
272 anchors += 'anchors.left: mascotImage.right; \
266 anchors.leftMargin: units.gu(1);';
273 anchors.leftMargin: units.gu(1);';
267 } else {
274 } else {
268− anchors += 'anchors.left: parent.left; \
275+ anchors += 'anchors.left: parent.left;';
269− anchors.leftMargin: units.gu(1);';
270 }
276 }
271 anchors += headerVerticalAnchors;
277 anchors += headerVerticalAnchors;
272
278
@@ -274,6 +280,7 @@ function createCardComponent(parent, template, components) {
274 var subtitleAnchors = "";
280 var subtitleAnchors = "";
275 if (hasMascot && hasSubtitle) {
281 if (hasMascot && hasSubtitle) {
276 titleAnchors = 'anchors { left: parent.left; right: parent.right }';
282 titleAnchors = 'anchors { left: parent.left; right: parent.right }';
283+ subtitleAnchors = titleAnchors;
277 code += 'Item { \
284 code += 'Item { \
278 ' + anchors + '\
285 ' + anchors + '\
279 height: mascotImage.height; \
286 height: mascotImage.height; \
@@ -284,7 +291,7 @@ function createCardComponent(parent, template, components) {
284 } else {
291 } else {
285 titleAnchors = anchors;
292 titleAnchors = anchors;
286 subtitleAnchors = 'anchors.left: parent.left; \
293 subtitleAnchors = 'anchors.left: parent.left; \
287− anchors.leftMargin: units.gu(1); \
294+ anchors.right: parent.right; \
288 anchors.top: titleLabel.bottom; \
295 anchors.top: titleLabel.bottom; \
289 anchors.topMargin: units.dp(2);';
296 anchors.topMargin: units.dp(2);';
290 }
297 }
qml/Dash/CardCreatorCache.qml+1
@@ -16,6 +16,7 @@ QtObject {
16 var allString = tString + cString;
16 var allString = tString + cString;
17 var component = cache[allString];
17 var component = cache[allString];
18 if (component === undefined) {
18 if (component === undefined) {
19+ console.log("Create", tString, cString);
19 component = CardCreator.createCardComponent(root, template, components);
20 component = CardCreator.createCardComponent(root, template, components);
20 cache[allString] = component;
21 cache[allString] = component;
21 }
22 }