on xenial help sign in
Fix CardHeader title font weight.
8032128Michał Karnicki
po/es.po+1−1
@@ -15,7 +15,7 @@ msgstr ""
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17"Plural-Forms: nplurals=2; plural=n != 1;\n"
17"Plural-Forms: nplurals=2; plural=n != 1;\n"
18−"X-Launchpad-Export-Date: 2014-02-20 05:47+0000\n"
18+"X-Launchpad-Export-Date: 2014-02-21 06:42+0000\n"
19"X-Generator: Launchpad (build 16916)\n"
19"X-Generator: Launchpad (build 16916)\n"
20
20
21#: plugins/Unity/Launcher/launcheritem.cpp:43
21#: plugins/Unity/Launcher/launcheritem.cpp:43
qml/Dash/Card.qml+2
@@ -161,6 +161,8 @@ AbstractButton {
161 title: cardData && cardData["title"] || ""
161 title: cardData && cardData["title"] || ""
162 subtitle: cardData && cardData["subtitle"] || ""
162 subtitle: cardData && cardData["subtitle"] || ""
163
163
164+ titleWeight: components && components["subtitle"] ? Font.DemiBold : Font.Normal
165+
164 opacity: showHeader ? 1 : 0
166 opacity: showHeader ? 1 : 0
165 inOverlay: root.template && root.template["overlay"] === true
167 inOverlay: root.template && root.template["overlay"] === true
166 fontColor: inOverlay ? "white" : summary.color
168 fontColor: inOverlay ? "white" : summary.color
qml/Dash/CardHeader.qml+2
@@ -26,6 +26,8 @@ Item {
26 property alias oldPrice: oldPriceLabel.text
26 property alias oldPrice: oldPriceLabel.text
27 property alias altPrice: altPriceLabel.text
27 property alias altPrice: altPriceLabel.text
28
28
29+ property alias titleWeight: titleLabel.font.weight
30+
29 // FIXME: Saviq, used to scale fonts down in Carousel
31 // FIXME: Saviq, used to scale fonts down in Carousel
30 property real fontScale: 1.0
32 property real fontScale: 1.0
31
33
tests/qmltests/Dash/tst_Card.qml+14
@@ -182,6 +182,7 @@ Rectangle {
182 when: windowShown
182 when: windowShown
183
183
184 property Item header: findChild(card, "cardHeader")
184 property Item header: findChild(card, "cardHeader")
185+ property Item title: findChild(header, "titleLabel")
185 property Item art: findChild(card, "artShape")
186 property Item art: findChild(card, "artShape")
186 property Item artImage: findChild(card, "artImage")
187 property Item artImage: findChild(card, "artImage")
187 property Item summary: findChild(card, "summaryLabel")
188 property Item summary: findChild(card, "summaryLabel")
@@ -413,5 +414,18 @@ Rectangle {
413 tryCompare(backgroundImage, "source", data.image);
414 tryCompare(backgroundImage, "source", data.image);
414 }
415 }
415 }
416 }
417+
418+ function test_font_weights_data() {
419+ return [
420+ { tag: "Title only", index: 8, weight: Font.Normal },
421+ { tag: "Title, subtitle", index: 0, weight: Font.DemiBold },
422+ ]
423+ }
424+
425+ function test_font_weights(data) {
426+ selector.selectedIndex = data.index;
427+
428+ tryCompare(testCase.title.font, "weight", data.weight);
429+ }
416 }
430 }
417}
431}