@@ -23,10 +23,14 @@ AbstractButton {
23 property var components
23 property var components
24 property var cardData
24 property var cardData
26+ property alias fontScale: header.fontScale
26 property alias headerAlignment: header.headerAlignment
27 property alias headerAlignment: header.headerAlignment
28+ readonly property alias headerHeight: header.height
30+ property bool showHeader: true
28 implicitWidth: childrenRect.width
32 implicitWidth: childrenRect.width
29− implicitHeight: childrenRect.height
33+ implicitHeight: summary.y + summary.height
31 UbuntuShape {
35 UbuntuShape {
32 id: artShape
36 id: artShape
@@ -60,21 +64,77 @@ AbstractButton {
71+ right: artShape.right
72+ bottom: artShape.bottom
75+ height: header.height
76+ opacity: header.opacity * 0.6
77+ visible: template && template["overlay"] && artShape.visible && artShape.image.status === Image.Ready || false
79+ property var source: ShaderEffectSource {
82+ onVisibleChanged: if (visible) scheduleUpdate()
84+ sourceRect: Qt.rect(0, artShape.height - overlay.height, artShape.width, overlay.height)
88+ uniform highp mat4 qt_Matrix;
89+ attribute highp vec4 qt_Vertex;
90+ attribute highp vec2 qt_MultiTexCoord0;
91+ varying highp vec2 coord;
93+ coord = qt_MultiTexCoord0;
94+ gl_Position = qt_Matrix * qt_Vertex;
98+ varying highp vec2 coord;
99+ uniform sampler2D source;
100+ uniform lowp float qt_Opacity;
102+ lowp vec4 tex = texture2D(source, coord);
103+ gl_FragColor = vec4(0, 0, 0, tex.a) * qt_Opacity;
63 CardHeader {
107 CardHeader {
64 id: header
108 id: header
65 objectName: "cardHeader"
109 objectName: "cardHeader"
66 anchors {
110 anchors {
113+ if (template["overlay"]) return overlay.top;
67− top: template && template["card-layout"] === "horizontal" ? artShape.top : artShape.bottom
114+ if (template["card-layout"] === "horizontal") return artShape.top;
116+ return artShape.bottom;
68− left: template && template["card-layout"] === "horizontal" ? artShape.right : parent.left
120+ if (!template["overlay"] && template["card-layout"] === "horizontal") return artShape.right;
69 right: parent.right
124 right: parent.right
72 mascot: cardData && cardData["mascot"] || ""
127 mascot: cardData && cardData["mascot"] || ""
73 title: cardData && cardData["title"] || ""
128 title: cardData && cardData["title"] || ""
74 subtitle: cardData && cardData["subtitle"] || ""
129 subtitle: cardData && cardData["subtitle"] || ""
131+ opacity: showHeader ? 1 : 0
133+ Behavior on opacity { NumberAnimation { duration: UbuntuAnimation.SnapDuration } }
78 objectName: "summaryLabel"
138 objectName: "summaryLabel"
79 anchors { top: header.visible ? header.bottom : artShape.bottom; left: parent.left; right: parent.right }
139 anchors { top: header.visible ? header.bottom : artShape.bottom; left: parent.left; right: parent.right }
80 wrapMode: Text.Wrap
140 wrapMode: Text.Wrap