on xenial help sign in
Fix CardHeader title font weight.
commit8032128a99fde455e6ed253ea0b6729fdc535d3c authorMichał Karnicki <michal.karnicki@canonical.com> dateFri 21 Feb 2014, 12:13 (13 years ago) parentf9bf55be634da8
4 files changed+19−1
po/es.po+1−1 qml/Dash/Card.qml+2 qml/Dash/CardHeader.qml+2 tests/qmltests/Dash/tst_Card.qml+14
po/es.po+1−1
@@ -15,7 +15,7 @@ msgstr ""
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"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"
1919"X-Generator: Launchpad (build 16916)\n"
2020
2121#: plugins/Unity/Launcher/launcheritem.cpp:43
qml/Dash/Card.qml+2
@@ -161,6 +161,8 @@ AbstractButton {
161161 title: cardData && cardData["title"] || ""
162162 subtitle: cardData && cardData["subtitle"] || ""
163163
164+ titleWeight: components && components["subtitle"] ? Font.DemiBold : Font.Normal
165+
164166 opacity: showHeader ? 1 : 0
165167 inOverlay: root.template && root.template["overlay"] === true
166168 fontColor: inOverlay ? "white" : summary.color
qml/Dash/CardHeader.qml+2
@@ -26,6 +26,8 @@ Item {
2626 property alias oldPrice: oldPriceLabel.text
2727 property alias altPrice: altPriceLabel.text
2828
29+ property alias titleWeight: titleLabel.font.weight
30+
2931 // FIXME: Saviq, used to scale fonts down in Carousel
3032 property real fontScale: 1.0
3133
tests/qmltests/Dash/tst_Card.qml+14
@@ -182,6 +182,7 @@ Rectangle {
182182 when: windowShown
183183
184184 property Item header: findChild(card, "cardHeader")
185+ property Item title: findChild(header, "titleLabel")
185186 property Item art: findChild(card, "artShape")
186187 property Item artImage: findChild(card, "artImage")
187188 property Item summary: findChild(card, "summaryLabel")
@@ -413,5 +414,18 @@ Rectangle {
413414 tryCompare(backgroundImage, "source", data.image);
414415 }
415416 }
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+ }
416430 }
417431}