on xenial help sign in
Better variable name
db87b68Albert Astals
plugins/Dash/CardCreator.js+8−8
@@ -39,7 +39,7 @@ function cardString(template, components) {
39 var hasBackground = !isHorizontal && (template["card-background"] || components["background"] || artAndSummary);
39 var hasBackground = !isHorizontal && (template["card-background"] || components["background"] || artAndSummary);
40 var hasTitle = components["title"] || false;
40 var hasTitle = components["title"] || false;
41 var hasMascot = components["mascot"] || false;
41 var hasMascot = components["mascot"] || false;
42− var inOverlay = hasArt && template && template["overlay"] === true && (hasTitle || hasMascot);
42+ var headerAsOverlay = hasArt && template && template["overlay"] === true && (hasTitle || hasMascot);
43 var hasSubtitle = components["subtitle"] || false;
43 var hasSubtitle = components["subtitle"] || false;
44 var hasHeaderRow = hasMascot && hasTitle;
44 var hasHeaderRow = hasMascot && hasTitle;
45
45
@@ -141,7 +141,7 @@ function cardString(template, components) {
141 code += 'readonly property size artShapeSize: Qt.size(-1, -1);\n'
141 code += 'readonly property size artShapeSize: Qt.size(-1, -1);\n'
142 }
142 }
143
143
144− if (inOverlay) {
144+ if (headerAsOverlay) {
145 var height = 'fixedHeaderHeight != -1 ? fixedHeaderHeight : headerHeight;\n';
145 var height = 'fixedHeaderHeight != -1 ? fixedHeaderHeight : headerHeight;\n';
146 code += 'Loader { \n\
146 code += 'Loader { \n\
147 id: overlayLoader; \n\
147 id: overlayLoader; \n\
@@ -186,7 +186,7 @@ function cardString(template, components) {
186 }
186 }
187
187
188 var headerVerticalAnchors;
188 var headerVerticalAnchors;
189− if (inOverlay) {
189+ if (headerAsOverlay) {
190 headerVerticalAnchors = 'anchors.bottom: artShapeHolder.bottom; \n\
190 headerVerticalAnchors = 'anchors.bottom: artShapeHolder.bottom; \n\
191 anchors.bottomMargin: units.gu(1);\n';
191 anchors.bottomMargin: units.gu(1);\n';
192 } else {
192 } else {
@@ -235,7 +235,7 @@ function cardString(template, components) {
235 }
235 }
236
236
237 if (hasMascot) {
237 if (hasMascot) {
238− var useMascotShape = !hasBackground && !inOverlay;
238+ var useMascotShape = !hasBackground && !headerAsOverlay;
239 var anchors = "";
239 var anchors = "";
240 if (!hasHeaderRow) {
240 if (!hasHeaderRow) {
241 anchors += headerLeftAnchor;
241 anchors += headerLeftAnchor;
@@ -281,7 +281,7 @@ function cardString(template, components) {
281
281
282 if (hasTitle) {
282 if (hasTitle) {
283 var color;
283 var color;
284− if (inOverlay) {
284+ if (headerAsOverlay) {
285 color = '"white"';
285 color = '"white"';
286 } else if (hasSummary) {
286 } else if (hasSummary) {
287 color = 'summary.color';
287 color = 'summary.color';
@@ -302,7 +302,7 @@ function cardString(template, components) {
302 width: parent.width - x;\n';
302 width: parent.width - x;\n';
303 } else if (hasMascot) {
303 } else if (hasMascot) {
304 titleAnchors = 'anchors.verticalCenter: parent.verticalCenter;\n'
304 titleAnchors = 'anchors.verticalCenter: parent.verticalCenter;\n'
305− } else if (inOverlay) {
305+ } else if (headerAsOverlay) {
306 titleAnchors = 'anchors.left: parent.left; \n\
306 titleAnchors = 'anchors.left: parent.left; \n\
307 anchors.leftMargin: units.gu(1); \n\
307 anchors.leftMargin: units.gu(1); \n\
308 anchors.right: parent.right; \n\
308 anchors.right: parent.right; \n\
@@ -339,7 +339,7 @@ function cardString(template, components) {
339 maximumLineCount: 2; \n\
339 maximumLineCount: 2; \n\
340 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale); \n\
340 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale); \n\
341 color: ' + color + '; \n\
341 color: ' + color + '; \n\
342− visible: showHeader ' + (inOverlay ? '&& overlayLoader.active': '') + '; \n\
342+ visible: showHeader ' + (headerAsOverlay ? '&& overlayLoader.active': '') + '; \n\
343 text: root.title; \n\
343 text: root.title; \n\
344 font.weight: components && components["subtitle"] ? Font.DemiBold : Font.Normal; \n\
344 font.weight: components && components["subtitle"] ? Font.DemiBold : Font.Normal; \n\
345 horizontalAlignment: root.headerAlignment; \n\
345 horizontalAlignment: root.headerAlignment; \n\
@@ -374,7 +374,7 @@ function cardString(template, components) {
374 if (hasSummary) {
374 if (hasSummary) {
375 var summaryTopAnchor;
375 var summaryTopAnchor;
376 if (isHorizontal && hasArt) summaryTopAnchor = "artShapeHolder.bottom";
376 if (isHorizontal && hasArt) summaryTopAnchor = "artShapeHolder.bottom";
377− else if (inOverlay && hasArt) summaryTopAnchor = "artShapeHolder.bottom";
377+ else if (headerAsOverlay && hasArt) summaryTopAnchor = "artShapeHolder.bottom";
378 else if (hasHeaderRow) summaryTopAnchor = "row.bottom";
378 else if (hasHeaderRow) summaryTopAnchor = "row.bottom";
379 else if (hasMascot) summaryTopAnchor = "mascotImage.bottom";
379 else if (hasMascot) summaryTopAnchor = "mascotImage.bottom";
380 else if (hasSubtitle) summaryTopAnchor = "subtitleLabel.bottom";
380 else if (hasSubtitle) summaryTopAnchor = "subtitleLabel.bottom";