@@ -23,8 +23,13 @@ Item {
23 property var components
23 property var components
24 property var cardData
24 property var cardData
26+ property alias fontScale: header.fontScale
27+ readonly property alias headerHeight: header.height
29+ property bool showHeader: true
26 implicitWidth: childrenRect.width
31 implicitWidth: childrenRect.width
27− implicitHeight: childrenRect.height
32+ implicitHeight: summary.y + summary.height
29 UbuntuShape {
34 UbuntuShape {
30 id: artShape
35 id: artShape
@@ -58,21 +63,77 @@ Item {
70+ right: artShape.right
71+ bottom: artShape.bottom
74+ height: header.height
75+ opacity: header.opacity * 0.6
76+ visible: template && template["overlay"] && artShape.visible && artShape.image.status === Image.Ready || false
78+ property var source: ShaderEffectSource {
81+ onVisibleChanged: if (visible) scheduleUpdate()
83+ sourceRect: Qt.rect(0, artShape.height - overlay.height, artShape.width, overlay.height)
87+ uniform highp mat4 qt_Matrix;
88+ attribute highp vec4 qt_Vertex;
89+ attribute highp vec2 qt_MultiTexCoord0;
90+ varying highp vec2 coord;
92+ coord = qt_MultiTexCoord0;
93+ gl_Position = qt_Matrix * qt_Vertex;
97+ varying highp vec2 coord;
98+ uniform sampler2D source;
99+ uniform lowp float qt_Opacity;
101+ lowp vec4 tex = texture2D(source, coord);
102+ gl_FragColor = vec4(0, 0, 0, tex.a) * qt_Opacity;
61 CardHeader {
106 CardHeader {
62 id: header
107 id: header
63 objectName: "cardHeader"
108 objectName: "cardHeader"
64 anchors {
109 anchors {
112+ if (template["overlay"]) return overlay.top;
65− top: template && template["card-layout"] === "horizontal" ? artShape.top : artShape.bottom
113+ if (template["card-layout"] === "horizontal") return artShape.top;
115+ return artShape.bottom;
66− left: template && template["card-layout"] === "horizontal" ? artShape.right : parent.left
119+ if (!template["overlay"] && template["card-layout"] === "horizontal") return artShape.right;
67 right: parent.right
123 right: parent.right
70 mascot: cardData && cardData["mascot"] || ""
126 mascot: cardData && cardData["mascot"] || ""
71 title: cardData && cardData["title"] || ""
127 title: cardData && cardData["title"] || ""
72 subtitle: cardData && cardData["subtitle"] || ""
128 subtitle: cardData && cardData["subtitle"] || ""
130+ opacity: showHeader ? 1 : 0
132+ Behavior on opacity { NumberAnimation { duration: UbuntuAnimation.SnapDuration } }
76 objectName: "summaryLabel"
137 objectName: "summaryLabel"
77 anchors { top: header.visible ? header.bottom : artShape.bottom; left: parent.left; right: parent.right }
138 anchors { top: header.visible ? header.bottom : artShape.bottom; left: parent.left; right: parent.right }
78 wrapMode: Text.Wrap
139 wrapMode: Text.Wrap