on xenial help sign in
Merge
commitf9806f91a72735bf9cd9efed0dd3eb03d01104a9 authorAlbert Astals <albert.astals@canonical.com> dateFri 21 Feb 2014, 13:31 (13 years ago) parent66e0bd08032128
10 files changed+29−8
po/es.po+1−1 qml/Components/ResponsiveGridView.qml−1 qml/Dash/Card.qml+2 qml/Dash/CardHeader.qml+2 qml/Dash/Dash.qml+2 qml/Dash/DashContent.qml+4 qml/Dash/GenericScopeView.qml+1 qml/Dash/PreviewListView.qml+1−1 qml/Dash/Previews/PreviewZoomableImage.qml+2−5 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/Components/ResponsiveGridView.qml−1
@@ -56,7 +56,6 @@ Item {
5656 fill: parent
5757 leftMargin: margin/2
5858 rightMargin: margin/2
59− topMargin: verticalSpacing
6059 }
6160 clip: parent.height != totalContentHeight
6261
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
qml/Dash/Dash.qml+2
@@ -41,6 +41,8 @@ Showable {
4141 return
4242 }
4343
44+ dashContent.closePreview();
45+
4446 if (scopeIndex == dashContent.currentIndex && !reset) {
4547 // the scope is already the current one
4648 return
qml/Dash/DashContent.qml+4
@@ -87,6 +87,10 @@ Item {
8787 dashContentList.currentItem.theScope.closeScope(scope)
8888 }
8989
90+ function closePreview() {
91+ previewListView.open = false;
92+ }
93+
9094 Item {
9195 id: dashContentListHolder
9296 anchors.fill: parent
qml/Dash/GenericScopeView.qml+1
@@ -137,6 +137,7 @@ FocusScope {
137137 id: baseItem
138138 objectName: "dashCategory" + category
139139 highlightWhenPressed: false
140+ showDivider: false
140141
141142 readonly property bool expandable: rendererLoader.item ? rendererLoader.item.expandable : false
142143 readonly property bool filtered: rendererLoader.item ? rendererLoader.item.filter : true
qml/Dash/PreviewListView.qml+1−1
@@ -181,7 +181,7 @@ Item {
181181
182182 ActivityIndicator {
183183 anchors.centerIn: parent
184− visible: parent.enabled
184+ visible: root.onScreen && parent.enabled
185185 running: visible
186186 }
187187 }
qml/Dash/Previews/PreviewZoomableImage.qml+2−5
@@ -30,11 +30,8 @@ PreviewWidget {
3030
3131 LazyImage {
3232 objectName: "image"
33− anchors {
34− top: parent.top
35− bottom: parent.bottom
36− }
37− scaleTo: "height"
33+ anchors.fill: parent
34+ scaleTo: "fit"
3835 source: widgetData["source"]
3936 initialWidth: units.gu(13)
4037 }
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}