on xenial help sign in
some fixes here and there
commit434f5ea4cc1ea4ca4039ec74aba1000201b936cf authorAlbert Astals <albert.astals@canonical.com> dateTue 29 Apr 2014, 17:15 (12 years ago) parent6b726d6
2 files changed+13−5
qml/Dash/CardCreator.js+12−5 qml/Dash/CardCreatorCache.qml+1
qml/Dash/CardCreator.js+12−5
@@ -139,6 +139,8 @@ function createCardComponent(parent, template, components) {
139139 } \
140140 } \
141141 }'
142+ } else {
143+ code += 'readonly property size artShapeSize: Qt.size(-1, -1);'
142144 }
143145
144146 if (inOverlay) {
@@ -199,8 +201,13 @@ function createCardComponent(parent, template, components) {
199201 headerVerticalAnchors = 'anchors.bottom: artShapeHolder.bottom; \
200202 anchors.bottomMargin: units.gu(1);';
201203 } else {
202− headerVerticalAnchors = 'anchors.top: artShapeHolder.bottom; \
203− anchors.topMargin: units.gu(1);';
204+ if (hasArt) {
205+ headerVerticalAnchors = 'anchors.top: artShapeHolder.bottom; \
206+ anchors.topMargin: units.gu(1);';
207+ } else {
208+ headerVerticalAnchors = 'anchors.top: parent.top; \
209+ anchors.topMargin: units.gu(1);';
210+ }
204211 }
205212 }
206213
@@ -265,8 +272,7 @@ function createCardComponent(parent, template, components) {
265272 anchors += 'anchors.left: mascotImage.right; \
266273 anchors.leftMargin: units.gu(1);';
267274 } else {
268− anchors += 'anchors.left: parent.left; \
269− anchors.leftMargin: units.gu(1);';
275+ anchors += 'anchors.left: parent.left;';
270276 }
271277 anchors += headerVerticalAnchors;
272278
@@ -274,6 +280,7 @@ function createCardComponent(parent, template, components) {
274280 var subtitleAnchors = "";
275281 if (hasMascot && hasSubtitle) {
276282 titleAnchors = 'anchors { left: parent.left; right: parent.right }';
283+ subtitleAnchors = titleAnchors;
277284 code += 'Item { \
278285 ' + anchors + '\
279286 height: mascotImage.height; \
@@ -284,7 +291,7 @@ function createCardComponent(parent, template, components) {
284291 } else {
285292 titleAnchors = anchors;
286293 subtitleAnchors = 'anchors.left: parent.left; \
287− anchors.leftMargin: units.gu(1); \
294+ anchors.right: parent.right; \
288295 anchors.top: titleLabel.bottom; \
289296 anchors.topMargin: units.dp(2);';
290297 }
qml/Dash/CardCreatorCache.qml+1
@@ -16,6 +16,7 @@ QtObject {
1616 var allString = tString + cString;
1717 var component = cache[allString];
1818 if (component === undefined) {
19+ console.log("Create", tString, cString);
1920 component = CardCreator.createCardComponent(root, template, components);
2021 cache[allString] = component;
2122 }