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
=== modified file 'qml/Dash/Previews/PreviewHeader.qml'
--- qml/Dash/Previews/PreviewHeader.qml 2014-05-02 15:48:08 +0000
+++ qml/Dash/Previews/PreviewHeader.qml 2014-05-19 08:14:19 +0000
@@ -56,6 +56,9 @@
5656
57 Loader {57 Loader {
58 id: mascotShapeLoader58 id: mascotShapeLoader
59 objectName: "mascotShapeLoader"
60 active: headerRoot.mascot != ""
61 visible: active
5962
60 anchors.verticalCenter: parent.verticalCenter63 anchors.verticalCenter: parent.verticalCenter
61 // TODO karni: Icon aspect-ratio is 8:7.5. Revisit these values to avoid fraction of pixels.64 // TODO karni: Icon aspect-ratio is 8:7.5. Revisit these values to avoid fraction of pixels.
6265
=== modified file 'tests/qmltests/Dash/Previews/tst_PreviewHeader.qml'
--- tests/qmltests/Dash/Previews/tst_PreviewHeader.qml 2014-05-02 15:48:08 +0000
+++ tests/qmltests/Dash/Previews/tst_PreviewHeader.qml 2014-05-19 08:14:19 +0000
@@ -53,12 +53,12 @@
53 name: "PreviewHeaderTest"53 name: "PreviewHeaderTest"
54 when: windowShown54 when: windowShown
5555
56 property Item mascot: findChild(previewHeader, "mascotShape")56 property Item mascotShapeLoader: findChild(previewHeader, "mascotShapeLoader")
57 property Item outerRow: findChild(previewHeader, "outerRow")57 property Item outerRow: findChild(previewHeader, "outerRow")
58 property Item column: findChild(previewHeader, "column")58 property Item column: findChild(previewHeader, "column")
5959
60 function initTestCase() {60 function initTestCase() {
61 verify(typeof testCase.mascot === "object", "Couldn't find mascot object.");61 verify(typeof testCase.mascotShapeLoader === "object", "Couldn't find mascot loader object.");
62 verify(typeof testCase.outerRow === "object", "Couldn't find outerRow object.");62 verify(typeof testCase.outerRow === "object", "Couldn't find outerRow object.");
63 verify(typeof testCase.column === "object", "Couldn't find column object.");63 verify(typeof testCase.column === "object", "Couldn't find column object.");
6464
@@ -70,9 +70,9 @@
7070
71 function test_mascot_data() {71 function test_mascot_data() {
72 return [72 return [
73 { tag: "Empty", source: "", visible: false },73 { tag: "Empty", source: "", loaderVisible: false, visible: false },
74 { tag: "Invalid", source: "bad_path", visible: false },74 { tag: "Invalid", source: "bad_path", loaderVisible: true, visible: false },
75 { tag: "Valid", source: "../graphics/play_button.png", visible: true },75 { tag: "Valid", source: "../graphics/play_button.png", loaderVisible: true, visible: true },
76 ]76 ]
77 }77 }
7878
@@ -80,12 +80,17 @@
80 headerjson.mascot = data.source;80 headerjson.mascot = data.source;
81 previewHeader.widgetData = headerjson;81 previewHeader.widgetData = headerjson;
8282
83 tryCompare(testCase.mascot, "visible", data.visible);83 tryCompare(testCase.mascotShapeLoader, "visible", data.loaderVisible);
84 if (data.loaderVisible) {
85 tryCompareFunction(function() { return findChild(previewHeader, "mascotShape") != null }, true);
86 var mascot = findChild(previewHeader, "mascotShape")
87 tryCompare(mascot, "visible", data.visible);
88 }
84 }89 }
8590
86 function test_dimensions_data() {91 function test_dimensions_data() {
87 return [92 return [
88 { tag: "Column width with mascot", object: column, width: previewHeader.width - mascot.width - outerRow.margins * 3, mascot: "artwork/avatar.png" },93 { tag: "Column width with mascot", object: column, width: previewHeader.width - mascotShapeLoader.width - outerRow.margins * 3, mascot: "artwork/avatar.png" },
89 { tag: "Header height", object: previewHeader, height: function() { return outerRow.height + outerRow.margins * 2 } },94 { tag: "Header height", object: previewHeader, height: function() { return outerRow.height + outerRow.margins * 2 } },
90 ]95 ]
91 }96 }

Subscribers

People subscribed via source and target branches