~aacid/unity8/dashviews_integration

« back to all changes in this revision

Viewing changes to plugins/Dash/CardCreator.js

  • Committer: Albert Astals
  • Date: 2014-06-18 10:26:01 UTC
  • Revision ID: albert.astals@canonical.com-20140618102601-vdtxi8pi0p9mgldh
Make the rowHeight be the headerHeight if we have it

Shuffle a bit the margins in headerHeight/fixedHeaderHeight

Show diffs side-by-side

added added

removed removed

Lines of Context:
108
108
                            visible: showHeader && status == Loader.Ready; \n\
109
109
                            sourceComponent: ShaderEffect { \n\
110
110
                                id: overlay; \n\
111
 
                                height: fixedHeaderHeight != -1 ? fixedHeaderHeight : headerHeight; \n\
 
111
                                height: fixedHeaderHeight != -1 ? fixedHeaderHeight + units.gu(1) * 2 : headerHeight; \n\
112
112
                                opacity: 0.6; \n\
113
113
                                property var source: ShaderEffectSource { \n\
114
114
                                    id: shaderSource; \n\
145
145
                        objectName: "outerRow"; \n\
146
146
                        property real margins: units.gu(1); \n\
147
147
                        spacing: margins; \n\
 
148
                        height: root.fixedHeaderHeight != -1 ? root.fixedHeaderHeight : implicitHeight; \n\
148
149
                        anchors { %1 } \n\
149
150
                        anchors.right: parent.right; \n\
150
151
                        anchors.margins: margins;\n\
163
164
                        objectName: "outerRow"; \n\
164
165
                        property real margins: units.gu(1); \n\
165
166
                        spacing: margins; \n\
 
167
                        height: root.fixedHeaderHeight != -1 ? root.fixedHeaderHeight : implicitHeight; \n\
166
168
                        anchors { %1 } \n\
167
169
                        anchors.right: parent.right; \n\
168
170
                        anchors.margins: margins;\n\
315
317
            anchors = 'left: parent.left';
316
318
            if (hasMascot || hasTitle) {
317
319
                widthCode = 'height * artShape.aspect'
318
 
                heightCode = 'headerHeight';
 
320
                heightCode = 'headerHeight + 2 * units.gu(1)';
319
321
            } else {
320
322
                // This side of the else is a bit silly, who wants an horizontal layout without mascot and title?
321
323
                // So we define a "random" height of the image height + 2 gu for the margins
366
368
    }
367
369
 
368
370
    if (hasHeaderRow) {
369
 
        code += 'readonly property int headerHeight: row.height + row.margins * 2;\n'
 
371
        code += 'readonly property int headerHeight: row.height;\n'
370
372
    } else if (hasMascot) {
371
 
        code += 'readonly property int headerHeight: mascotImage.height + units.gu(1) * 2;\n'
 
373
        code += 'readonly property int headerHeight: mascotImage.height;\n'
372
374
    } else if (hasSubtitle) {
373
 
        code += 'readonly property int headerHeight: titleLabel.height + titleLabel.anchors.topMargin * 2 + subtitleLabel.height + subtitleLabel.anchors.topMargin;\n'
 
375
        code += 'readonly property int headerHeight: titleLabel.height + subtitleLabel.height + subtitleLabel.anchors.topMargin;\n'
374
376
    } else if (hasTitle) {
375
 
        code += 'readonly property int headerHeight: titleLabel.height + titleLabel.anchors.topMargin * 2;\n'
 
377
        code += 'readonly property int headerHeight: titleLabel.height;\n'
376
378
    } else {
377
379
        code += 'readonly property int headerHeight: 0;\n'
378
380
    }