@@ -23,8 +23,10 @@ AbstractButton {
2323 property var components
2424 property var cardData
2525
26+ property alias fontScale: header.fontScale
27+
2628 implicitWidth: childrenRect.width
27− implicitHeight: childrenRect.height
29+ implicitHeight: summary.y + summary.height
2830
2931 UbuntuShape {
3032 id: artShape
@@ -58,13 +60,67 @@ AbstractButton {
5860 }
5961 }
6062
63+ ShaderEffect {
64+ id: overlay
65+ anchors {
66+ left: artShape.left
67+ right: artShape.right
68+ bottom: artShape.bottom
69+ }
70+
71+ height: units.gu(8)
72+ opacity: 0.6
73+ visible: template && template["overlay"] && artShape.visible && artShape.image.status === Image.Ready || false
74+
75+ property var source: ShaderEffectSource {
76+ id: shaderSource
77+ sourceItem: artShape
78+ onVisibleChanged: if (visible) scheduleUpdate()
79+ live: false
80+ sourceRect: Qt.rect(0, artShape.height - overlay.height, artShape.width, overlay.height)
81+ }
82+
83+ vertexShader: "
84+ uniform highp mat4 qt_Matrix;
85+ attribute highp vec4 qt_Vertex;
86+ attribute highp vec2 qt_MultiTexCoord0;
87+ varying highp vec2 coord;
88+ void main() {
89+ coord = qt_MultiTexCoord0;
90+ gl_Position = qt_Matrix * qt_Vertex;
91+ }"
92+
93+ fragmentShader: "
94+ varying highp vec2 coord;
95+ uniform sampler2D source;
96+ uniform lowp float qt_Opacity;
97+ void main() {
98+ lowp vec4 tex = texture2D(source, coord);
99+ gl_FragColor = vec4(0, 0, 0, tex.a) * qt_Opacity;
100+ }"
101+
102+ }
103+
61104 CardHeader {
62105 id: header
63106 objectName: "cardHeader"
64107 anchors {
65− top: template && template["card-layout"] === "horizontal" ? artShape.top : artShape.bottom
66− left: template && template["card-layout"] === "horizontal" ? artShape.right : parent.left
108+ top: {
109+ if (template) {
110+ if (template["overlay"]) return overlay.top;
111+ if (template["card-layout"] === "horizontal") return artShape.top;
112+ }
113+ return artShape.bottom;
114+ }
115+ left: {
116+ if (template) {
117+ if (!template["overlay"] && template["card-layout"] === "horizontal") return artShape.right;
118+ }
119+ return parent.left;
120+ }
67121 right: parent.right
122+ margins: template && template["overlay"] ? units.gu(1) : 0
123+ topMargin: 0
68124 }
69125
70126 mascot: cardData && cardData["mascot"] || ""
@@ -73,6 +129,7 @@ AbstractButton {
73129 }
74130
75131 Label {
132+ id: summary
76133 objectName: "summaryLabel"
77134 anchors { top: header.visible ? header.bottom : artShape.bottom; left: parent.left; right: parent.right }
78135 wrapMode: Text.Wrap