on xenial help sign in
Bring changes from newscopes.
commit0d2862a8439b1e8cb95375dba34f0ba86f42c016 authorMichał Sawicz <michal.sawicz@canonical.com> dateWed 5 Feb 2014, 21:47 (13 years ago) parent75c2b5e
2 files changed+10−5
qml/Dash/Card.qml+7−4 qml/Dash/CardHeader.qml+3−1
qml/Dash/Card.qml+7−4
@@ -25,6 +25,8 @@ Item {
2525
2626 property alias fontScale: header.fontScale
2727
28+ property bool showHeader: true
29+
2830 implicitWidth: childrenRect.width
2931 implicitHeight: summary.y + summary.height
3032
@@ -69,7 +71,7 @@ Item {
6971 }
7072
7173 height: units.gu(8)
72− opacity: 0.6
74+ opacity: header.opacity * 0.6
7375 visible: template && template["overlay"] && artShape.visible && artShape.image.status === Image.Ready || false
7476
7577 property var source: ShaderEffectSource {
@@ -98,7 +100,6 @@ Item {
98100 lowp vec4 tex = texture2D(source, coord);
99101 gl_FragColor = vec4(0, 0, 0, tex.a) * qt_Opacity;
100102 }"
101−
102103 }
103104
104105 CardHeader {
@@ -119,13 +120,15 @@ Item {
119120 return parent.left;
120121 }
121122 right: parent.right
122− margins: template && template["overlay"] ? units.gu(1) : 0
123− topMargin: 0
124123 }
125124
126125 mascot: cardData && cardData["mascot"] || ""
127126 title: cardData && cardData["title"] || ""
128127 subtitle: cardData && cardData["subtitle"] || ""
128+
129+ opacity: showHeader ? 1 : 0
130+
131+ Behavior on opacity { NumberAnimation { duration: UbuntuAnimation.SnapDuration } }
129132 }
130133
131134 Label {
qml/Dash/CardHeader.qml+3−1
@@ -44,7 +44,7 @@ Item {
4444 leftMargin: spacing
4545 rightMargin: spacing
4646 }
47− spacing: mascotShape.visible ? margins : 0
47+ spacing: mascotShape.visible || (template && template["overlay"]) ? margins : 0
4848
4949 UbuntuShape {
5050 id: mascotShape
@@ -81,6 +81,7 @@ Item {
8181 maximumLineCount: 2
8282 fontSize: "small"
8383 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale)
84+ color: template["overlay"] === true ? "white" : "grey"
8485 }
8586
8687 Label {
@@ -92,6 +93,7 @@ Item {
9293 visible: titleLabel.text && text
9394 fontSize: "x-small"
9495 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale)
96+ color: template["overlay"] === true ? "white" : "grey"
9597 }
9698
9799 Row {