Merge lp:~saviq/unity8/improve-card-cardheader-layouts into lp:unity8

Proposed by Michał Sawicz
Status: Merged
Approved by: Michał Karnicki
Approved revision: 676
Merged at revision: 680
Proposed branch: lp:~saviq/unity8/improve-card-cardheader-layouts
Merge into: lp:unity8
Diff against target: 143 lines (+42/-12)
4 files modified
qml/Dash/Card.qml (+3/-1)
qml/Dash/CardHeader.qml (+14/-3)
tests/qmltests/Dash/tst_Card.qml (+22/-5)
tests/qmltests/Dash/tst_CardHeader.qml (+3/-3)
To merge this branch: bzr merge lp:~saviq/unity8/improve-card-cardheader-layouts
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Michał Karnicki (community) Approve
Review via email: mp+204092@code.launchpad.net

Commit message

Improve Card and CardHeader layouts:
- anchor summary to art when no header
- don't indent header when no mascot
- reduce header and summary font sizes and weights
- increase art shape radius

Description of the change

 * Are there any related MPs required for this MP to build/function as expected? Please list.
No.

 * Did you perform an exploratory manual test run of your code change and any related functionality?
Yes. Tested the changes with new-scopes and it looks much closer to design (and better, too).

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A

 * If you changed the UI, has there been a design review?
Will do a complete design review later with the rest of new scopes.

To post a comment you must log in.
675. By Michał Sawicz

Change font size and weights.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:674
http://jenkins.qa.ubuntu.com/job/unity8-ci/2183/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/2773
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/2533
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1056
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/705
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/707
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/707/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/705
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/2424
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2775
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2775/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2534
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2534/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/4962
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/3498

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2183/rebuild

review: Needs Fixing (continuous-integration)
676. By Michał Sawicz

Make summary "small".

Revision history for this message
Michał Karnicki (karni) wrote :

Did you perform an exploratory manual test run of the code change and any related functionality?
 * Ran related tests and tested in unity-scope-tool.

Did CI run pass? If not, please explain why.
 * Not passed, but fixed in another branch already.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:675
http://jenkins.qa.ubuntu.com/job/unity8-ci/2184/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/2775
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/2534
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1057
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/706
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/708
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/708/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/706
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/2426
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2777
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2777/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2535
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2535/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/4963
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/3499

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2184/rebuild

review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Dash/Card.qml'
2--- qml/Dash/Card.qml 2014-01-28 17:13:29 +0000
3+++ qml/Dash/Card.qml 2014-01-30 21:18:44 +0000
4@@ -37,6 +37,7 @@
5
6 UbuntuShape {
7 id: artShape
8+ radius: "medium"
9 objectName: "artShape"
10 width: {
11 if (!visible) return 0
12@@ -82,11 +83,12 @@
13
14 Label {
15 objectName: "summaryLabel"
16- anchors { top: header.bottom; left: parent.left; right: parent.right }
17+ anchors { top: header.visible ? header.bottom : artShape.bottom; left: parent.left; right: parent.right }
18 wrapMode: Text.Wrap
19 maximumLineCount: 5
20 elide: Text.ElideRight
21 text: cardData && cardData["summary"] || ""
22 height: text ? implicitHeight : 0
23+ fontSize: "small"
24 }
25 }
26
27=== modified file 'qml/Dash/CardHeader.qml'
28--- qml/Dash/CardHeader.qml 2014-01-27 21:23:05 +0000
29+++ qml/Dash/CardHeader.qml 2014-01-30 21:18:44 +0000
30@@ -27,14 +27,21 @@
31 property alias altPrice: altPriceLabel.text
32
33 visible: mascotImage.status === Image.Ready || title || price
34- height: row.height > 0 ? row.height + row.spacing * 2 : 0
35+ height: row.height > 0 ? row.height + row.margins * 2 : 0
36
37 Row {
38 id: row
39 objectName: "outerRow"
40
41- anchors { top: parent.top; left: parent.left; right: parent.right; margins: spacing }
42- spacing: units.gu(1)
43+ property real margins: units.gu(1)
44+
45+ anchors {
46+ top: parent.top; left: parent.left; right: parent.right
47+ margins: margins
48+ leftMargin: spacing
49+ rightMargin: spacing
50+ }
51+ spacing: mascotShape.visible ? margins : 0
52
53 UbuntuShape {
54 id: mascotShape
55@@ -53,6 +60,7 @@
56 Column {
57 objectName: "column"
58 width: parent.width - x
59+ spacing: units.gu(0.5)
60
61 Label {
62 id: titleLabel
63@@ -62,6 +70,7 @@
64 font.weight: Font.DemiBold
65 wrapMode: Text.Wrap
66 maximumLineCount: 2
67+ fontSize: "small"
68 }
69
70 Label {
71@@ -69,7 +78,9 @@
72 objectName: "subtitleLabel"
73 anchors { left: parent.left; right: parent.right }
74 elide: Text.ElideRight
75+ font.weight: Font.Light
76 visible: titleLabel.text && text
77+ fontSize: "x-small"
78 }
79
80 Row {
81
82=== modified file 'tests/qmltests/Dash/tst_Card.qml'
83--- tests/qmltests/Dash/tst_Card.qml 2014-01-28 17:20:57 +0000
84+++ tests/qmltests/Dash/tst_Card.qml 2014-01-30 21:18:44 +0000
85@@ -111,6 +111,10 @@
86 "layout": { "components": Helpers.update(JSON.parse(root.fullMapping), { "summary": undefined }) }
87 },
88 {
89+ "name": "Art, summary - vertical",
90+ "layout": { "components": { "art": "art", "summary": "summary" } }
91+ },
92+ {
93 "name": "Header title only - horizontal",
94 "layout": { "template": { "card-layout": "horizontal" },
95 "components": { "title": "title" } }
96@@ -356,13 +360,26 @@
97 tryCompareFunction(function() { return testCase.header.x === data.left() }, true);
98 }
99
100+ function test_summary_layout_data() {
101+ return [
102+ { tag: "With header", top: function() { return header.y + header.height }, index: 0 },
103+ { tag: "Without header", top: function() { return art.y + art.height }, index: 7 },
104+ ]
105+ }
106+
107+ function test_summary_layout(data) {
108+ selector.selectedIndex = data.index;
109+
110+ tryCompareFunction(function() { return testCase.summary.y === data.top() }, true);
111+ }
112+
113 function test_art_visibility() {
114- selector.selectedIndex = 7
115+ selector.selectedIndex = 8;
116
117- tryCompare(testCase.artImage, "source", "")
118- compare(testCase.art.visible, false)
119- compare(testCase.art.height, 0)
120- compare(testCase.art.width, 0)
121+ tryCompare(testCase.artImage, "source", "");
122+ compare(testCase.art.visible, false);
123+ compare(testCase.art.height, 0);
124+ compare(testCase.art.width, 0);
125 }
126 }
127 }
128
129=== modified file 'tests/qmltests/Dash/tst_CardHeader.qml'
130--- tests/qmltests/Dash/tst_CardHeader.qml 2014-01-27 21:23:05 +0000
131+++ tests/qmltests/Dash/tst_CardHeader.qml 2014-01-30 21:18:44 +0000
132@@ -120,9 +120,9 @@
133
134 function test_dimensions_data() {
135 return [
136- { tag: "Column width", object: column, width: cardHeader.width - testCase.outerRow.spacing * 2 },
137- { tag: "Column width", object: column, width: cardHeader.width - mascot.width - testCase.outerRow.spacing * 3, mascot: "artwork/avatar.png" },
138- { tag: "Header height", object: cardHeader, height: function() { return subtitleLabel.y + subtitleLabel.height + outerRow.spacing * 2 } },
139+ { tag: "Column width", object: column, width: cardHeader.width },
140+ { tag: "Column width with mascot", object: column, width: cardHeader.width - mascot.width - outerRow.margins * 3, mascot: "artwork/avatar.png" },
141+ { tag: "Header height", object: cardHeader, height: function() { return subtitleLabel.y + subtitleLabel.height + outerRow.margins * 2 } },
142 ]
143 }
144

Subscribers

People subscribed via source and target branches