on xenial help sign in
Bring changes from newscopes.
0d2862aMichał Sawicz
qml/Dash/Card.qml+7−4
@@ -25,6 +25,8 @@ Item {
25
25
26 property alias fontScale: header.fontScale
26 property alias fontScale: header.fontScale
27
27
28+ property bool showHeader: true
29+
28 implicitWidth: childrenRect.width
30 implicitWidth: childrenRect.width
29 implicitHeight: summary.y + summary.height
31 implicitHeight: summary.y + summary.height
30
32
@@ -69,7 +71,7 @@ Item {
69 }
71 }
70
72
71 height: units.gu(8)
73 height: units.gu(8)
72− opacity: 0.6
74+ opacity: header.opacity * 0.6
73 visible: template && template["overlay"] && artShape.visible && artShape.image.status === Image.Ready || false
75 visible: template && template["overlay"] && artShape.visible && artShape.image.status === Image.Ready || false
74
76
75 property var source: ShaderEffectSource {
77 property var source: ShaderEffectSource {
@@ -98,7 +100,6 @@ Item {
98 lowp vec4 tex = texture2D(source, coord);
100 lowp vec4 tex = texture2D(source, coord);
99 gl_FragColor = vec4(0, 0, 0, tex.a) * qt_Opacity;
101 gl_FragColor = vec4(0, 0, 0, tex.a) * qt_Opacity;
100 }"
102 }"
101−
102 }
103 }
103
104
104 CardHeader {
105 CardHeader {
@@ -119,13 +120,15 @@ Item {
119 return parent.left;
120 return parent.left;
120 }
121 }
121 right: parent.right
122 right: parent.right
122− margins: template && template["overlay"] ? units.gu(1) : 0
123− topMargin: 0
124 }
123 }
125
124
126 mascot: cardData && cardData["mascot"] || ""
125 mascot: cardData && cardData["mascot"] || ""
127 title: cardData && cardData["title"] || ""
126 title: cardData && cardData["title"] || ""
128 subtitle: cardData && cardData["subtitle"] || ""
127 subtitle: cardData && cardData["subtitle"] || ""
128+
129+ opacity: showHeader ? 1 : 0
130+
131+ Behavior on opacity { NumberAnimation { duration: UbuntuAnimation.SnapDuration } }
129 }
132 }
130
133
131 Label {
134 Label {
qml/Dash/CardHeader.qml+3−1
@@ -44,7 +44,7 @@ Item {
44 leftMargin: spacing
44 leftMargin: spacing
45 rightMargin: spacing
45 rightMargin: spacing
46 }
46 }
47− spacing: mascotShape.visible ? margins : 0
47+ spacing: mascotShape.visible || (template && template["overlay"]) ? margins : 0
48
48
49 UbuntuShape {
49 UbuntuShape {
50 id: mascotShape
50 id: mascotShape
@@ -81,6 +81,7 @@ Item {
81 maximumLineCount: 2
81 maximumLineCount: 2
82 fontSize: "small"
82 fontSize: "small"
83 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale)
83 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale)
84+ color: template["overlay"] === true ? "white" : "grey"
84 }
85 }
85
86
86 Label {
87 Label {
@@ -92,6 +93,7 @@ Item {
92 visible: titleLabel.text && text
93 visible: titleLabel.text && text
93 fontSize: "x-small"
94 fontSize: "x-small"
94 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale)
95 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale)
96+ color: template["overlay"] === true ? "white" : "grey"
95 }
97 }
96
98
97 Row {
99 Row {