Merge lp:~aacid/unity8/noiconpreviewheader into lp:unity8

Proposed by Albert Astals Cid
Status: Merged
Approved by: Andrea Cimitan
Approved revision: 894
Merged at revision: 922
Proposed branch: lp:~aacid/unity8/noiconpreviewheader
Merge into: lp:unity8
Diff against target: 65 lines (+15/-7)
2 files modified
qml/Dash/Previews/PreviewHeader.qml (+3/-0)
tests/qmltests/Dash/Previews/tst_PreviewHeader.qml (+12/-7)
To merge this branch: bzr merge lp:~aacid/unity8/noiconpreviewheader
Reviewer Review Type Date Requested Status
Andrea Cimitan (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Michal Hruby (community) Approve
Review via email: mp+219502@code.launchpad.net

Commit message

Don't reserve space for mascot if no mascot is specified

Description of the change

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

 * Did you perform an exploratory manual test run of your code change and any related functionality?
Yes

 * Did you make sure that your branch does not contain spurious tags?
Yes

 * 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?
N/A

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Michal Hruby (mhr3) wrote :

Looks reasonable to me, leaving for other QML guys to do proper review :)

review: Approve
lp:~aacid/unity8/noiconpreviewheader updated
894. By Albert Astals Cid

Merge

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Andrea Cimitan (cimi) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
yes
 * Did CI run pass? If not, please explain why.
yes

Revision history for this message
Andrea Cimitan (cimi) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Dash/Previews/PreviewHeader.qml'
2--- qml/Dash/Previews/PreviewHeader.qml 2014-05-02 15:48:08 +0000
3+++ qml/Dash/Previews/PreviewHeader.qml 2014-05-19 08:14:19 +0000
4@@ -56,6 +56,9 @@
5
6 Loader {
7 id: mascotShapeLoader
8+ objectName: "mascotShapeLoader"
9+ active: headerRoot.mascot != ""
10+ visible: active
11
12 anchors.verticalCenter: parent.verticalCenter
13 // TODO karni: Icon aspect-ratio is 8:7.5. Revisit these values to avoid fraction of pixels.
14
15=== modified file 'tests/qmltests/Dash/Previews/tst_PreviewHeader.qml'
16--- tests/qmltests/Dash/Previews/tst_PreviewHeader.qml 2014-05-02 15:48:08 +0000
17+++ tests/qmltests/Dash/Previews/tst_PreviewHeader.qml 2014-05-19 08:14:19 +0000
18@@ -53,12 +53,12 @@
19 name: "PreviewHeaderTest"
20 when: windowShown
21
22- property Item mascot: findChild(previewHeader, "mascotShape")
23+ property Item mascotShapeLoader: findChild(previewHeader, "mascotShapeLoader")
24 property Item outerRow: findChild(previewHeader, "outerRow")
25 property Item column: findChild(previewHeader, "column")
26
27 function initTestCase() {
28- verify(typeof testCase.mascot === "object", "Couldn't find mascot object.");
29+ verify(typeof testCase.mascotShapeLoader === "object", "Couldn't find mascot loader object.");
30 verify(typeof testCase.outerRow === "object", "Couldn't find outerRow object.");
31 verify(typeof testCase.column === "object", "Couldn't find column object.");
32
33@@ -70,9 +70,9 @@
34
35 function test_mascot_data() {
36 return [
37- { tag: "Empty", source: "", visible: false },
38- { tag: "Invalid", source: "bad_path", visible: false },
39- { tag: "Valid", source: "../graphics/play_button.png", visible: true },
40+ { tag: "Empty", source: "", loaderVisible: false, visible: false },
41+ { tag: "Invalid", source: "bad_path", loaderVisible: true, visible: false },
42+ { tag: "Valid", source: "../graphics/play_button.png", loaderVisible: true, visible: true },
43 ]
44 }
45
46@@ -80,12 +80,17 @@
47 headerjson.mascot = data.source;
48 previewHeader.widgetData = headerjson;
49
50- tryCompare(testCase.mascot, "visible", data.visible);
51+ tryCompare(testCase.mascotShapeLoader, "visible", data.loaderVisible);
52+ if (data.loaderVisible) {
53+ tryCompareFunction(function() { return findChild(previewHeader, "mascotShape") != null }, true);
54+ var mascot = findChild(previewHeader, "mascotShape")
55+ tryCompare(mascot, "visible", data.visible);
56+ }
57 }
58
59 function test_dimensions_data() {
60 return [
61- { tag: "Column width with mascot", object: column, width: previewHeader.width - mascot.width - outerRow.margins * 3, mascot: "artwork/avatar.png" },
62+ { tag: "Column width with mascot", object: column, width: previewHeader.width - mascotShapeLoader.width - outerRow.margins * 3, mascot: "artwork/avatar.png" },
63 { tag: "Header height", object: previewHeader, height: function() { return outerRow.height + outerRow.margins * 2 } },
64 ]
65 }

Subscribers

People subscribed via source and target branches