@@ -23,8 +23,13 @@ Item {
2323 property var components
2424 property var cardData
2525
26+ property alias fontScale: header.fontScale
27+ readonly property alias headerHeight: header.height
28+
29+ property bool showHeader: true
30+
2631 implicitWidth: childrenRect.width
27− implicitHeight: childrenRect.height
32+ implicitHeight: summary.y + summary.height
2833
2934 UbuntuShape {
3035 id: artShape
@@ -58,21 +63,77 @@ Item {
5863 }
5964 }
6065
66+ ShaderEffect {
67+ id: overlay
68+ anchors {
69+ left: artShape.left
70+ right: artShape.right
71+ bottom: artShape.bottom
72+ }
73+
74+ height: header.height
75+ opacity: header.opacity * 0.6
76+ visible: template && template["overlay"] && artShape.visible && artShape.image.status === Image.Ready || false
77+
78+ property var source: ShaderEffectSource {
79+ id: shaderSource
80+ sourceItem: artShape
81+ onVisibleChanged: if (visible) scheduleUpdate()
82+ live: false
83+ sourceRect: Qt.rect(0, artShape.height - overlay.height, artShape.width, overlay.height)
84+ }
85+
86+ vertexShader: "
87+ uniform highp mat4 qt_Matrix;
88+ attribute highp vec4 qt_Vertex;
89+ attribute highp vec2 qt_MultiTexCoord0;
90+ varying highp vec2 coord;
91+ void main() {
92+ coord = qt_MultiTexCoord0;
93+ gl_Position = qt_Matrix * qt_Vertex;
94+ }"
95+
96+ fragmentShader: "
97+ varying highp vec2 coord;
98+ uniform sampler2D source;
99+ uniform lowp float qt_Opacity;
100+ void main() {
101+ lowp vec4 tex = texture2D(source, coord);
102+ gl_FragColor = vec4(0, 0, 0, tex.a) * qt_Opacity;
103+ }"
104+ }
105+
61106 CardHeader {
62107 id: header
63108 objectName: "cardHeader"
64109 anchors {
65− top: template && template["card-layout"] === "horizontal" ? artShape.top : artShape.bottom
66− left: template && template["card-layout"] === "horizontal" ? artShape.right : parent.left
110+ top: {
111+ if (template) {
112+ if (template["overlay"]) return overlay.top;
113+ if (template["card-layout"] === "horizontal") return artShape.top;
114+ }
115+ return artShape.bottom;
116+ }
117+ left: {
118+ if (template) {
119+ if (!template["overlay"] && template["card-layout"] === "horizontal") return artShape.right;
120+ }
121+ return parent.left;
122+ }
67123 right: parent.right
68124 }
69125
70126 mascot: cardData && cardData["mascot"] || ""
71127 title: cardData && cardData["title"] || ""
72128 subtitle: cardData && cardData["subtitle"] || ""
129+
130+ opacity: showHeader ? 1 : 0
131+
132+ Behavior on opacity { NumberAnimation { duration: UbuntuAnimation.SnapDuration } }
73133 }
74134
75135 Label {
136+ id: summary
76137 objectName: "summaryLabel"
77138 anchors { top: header.visible ? header.bottom : artShape.bottom; left: parent.left; right: parent.right }
78139 wrapMode: Text.Wrap