Merge lp:~paulliu/unity8/divider20140729 into lp:unity8

Proposed by Ying-Chun Liu
Status: Merged
Approved by: Michał Sawicz
Approved revision: 1092
Merged at revision: 1119
Proposed branch: lp:~paulliu/unity8/divider20140729
Merge into: lp:unity8
Diff against target: 100 lines (+46/-0)
4 files modified
qml/Components/PageHeader.qml (+21/-0)
qml/Dash/DashContent.qml (+2/-0)
qml/Dash/GenericScopeView.qml (+2/-0)
tests/qmltests/Components/tst_PageHeader.qml (+21/-0)
To merge this branch: bzr merge lp:~paulliu/unity8/divider20140729
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Michał Sawicz Approve
Albert Astals Cid (community) Abstain
Review via email: mp+228708@code.launchpad.net

Commit message

Add divider dots.

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

 * 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?
Need someone to review.

To post a comment you must log in.
Michał Sawicz (saviq) wrote :

See inline.

review: Needs Fixing
lp:~paulliu/unity8/divider20140729 updated
1089. By Ying-Chun Liu on 2014-07-31

Rename dividerDots* to pagination*.
Remove some unused id.

1090. By Ying-Chun Liu on 2014-07-31

Merge trunk

Albert Astals Cid (aacid) wrote :

Text conflict in tests/qmltests/Components/tst_PageHeader.qml
1 conflicts encountered.

review: Needs Fixing
lp:~paulliu/unity8/divider20140729 updated
1091. By Ying-Chun Liu on 2014-08-01

merge trunk

1092. By Ying-Chun Liu on 2014-08-01

rename png

Albert Astals Cid (aacid) wrote :

Code merges now

review: Abstain
Michał Sawicz (saviq) 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.
No, restarted.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Components/PageHeader.qml'
2--- qml/Components/PageHeader.qml 2014-07-31 16:49:50 +0000
3+++ qml/Components/PageHeader.qml 2014-08-01 11:23:19 +0000
4@@ -35,6 +35,8 @@
5 property bool searchInProgress: false
6
7 property alias bottomItem: bottomContainer.children
8+ property int paginationCount: 0
9+ property int paginationIndex: -1
10
11 // TODO We should use foreground for the icons
12 // of the toolbar but unfortunately Action does not have
13@@ -294,6 +296,25 @@
14 }
15 }
16
17+ Row {
18+ spacing: units.gu(.5)
19+ Repeater {
20+ objectName: "paginationRepeater"
21+ model: root.paginationCount
22+ Image {
23+ objectName: "paginationDots_" + index
24+ height: units.gu(1)
25+ width: height
26+ source: (index == root.paginationIndex) ? "graphics/pagination_dot_on.png" : "graphics/pagination_dot_off.png"
27+ }
28+ }
29+ anchors {
30+ top: headerContainer.bottom
31+ horizontalCenter: headerContainer.horizontalCenter
32+ topMargin: units.gu(.5)
33+ }
34+ }
35+
36 Component {
37 id: popoverComponent
38 Popover {
39
40=== added file 'qml/Components/graphics/pagination_dot_off@30.png'
41Binary files qml/Components/graphics/pagination_dot_off@30.png 1970-01-01 00:00:00 +0000 and qml/Components/graphics/pagination_dot_off@30.png 2014-08-01 11:23:19 +0000 differ
42=== added file 'qml/Components/graphics/pagination_dot_on@30.png'
43Binary files qml/Components/graphics/pagination_dot_on@30.png 1970-01-01 00:00:00 +0000 and qml/Components/graphics/pagination_dot_on@30.png 2014-08-01 11:23:19 +0000 differ
44=== modified file 'qml/Dash/DashContent.qml'
45--- qml/Dash/DashContent.qml 2014-07-24 23:31:44 +0000
46+++ qml/Dash/DashContent.qml 2014-08-01 11:23:19 +0000
47@@ -143,6 +143,8 @@
48 item.scope = Qt.binding(function() { return scope })
49 item.isCurrent = Qt.binding(function() { return visible && ListView.isCurrentItem })
50 dashContent.scopeLoaded(item.scope.id)
51+ item.paginationCount = Qt.binding(function() { return dashContentList.count } )
52+ item.paginationIndex = Qt.binding(function() { return dashContentList.currentIndex } )
53 }
54 Connections {
55 target: isCurrent ? scope : null
56
57=== modified file 'qml/Dash/GenericScopeView.qml'
58--- qml/Dash/GenericScopeView.qml 2014-07-25 11:49:28 +0000
59+++ qml/Dash/GenericScopeView.qml 2014-08-01 11:23:19 +0000
60@@ -32,6 +32,8 @@
61 property bool hasBackAction: false
62 property bool enableHeightBehaviorOnNextCreation: false
63 property var categoryView: categoryView
64+ property alias paginationCount: pageHeader.paginationCount
65+ property alias paginationIndex: pageHeader.paginationIndex
66
67 property var scopeStyle: ScopeStyle {
68 style: scope ? scope.customizations : {}
69
70=== modified file 'tests/qmltests/Components/tst_PageHeader.qml'
71--- tests/qmltests/Components/tst_PageHeader.qml 2014-07-28 09:14:23 +0000
72+++ tests/qmltests/Components/tst_PageHeader.qml 2014-08-01 11:23:19 +0000
73@@ -192,6 +192,27 @@
74 ];
75 }
76
77+ function test_pagination() {
78+ var paginationRepeater = findChild(pageHeader, "paginationRepeater");
79+ tryCompare(paginationRepeater, "count", 0);
80+ pageHeader.paginationCount = 5;
81+ tryCompare(paginationRepeater, "count", 5);
82+ for (var i=0; i<pageHeader.paginationCount; i++) {
83+ pageHeader.paginationIndex = i;
84+ for (var j=0; j<paginationRepeater.count; j++) {
85+ var paginationDot = findChild(pageHeader, "paginationDots_"+j);
86+ if (i==j) {
87+ compare(paginationDot.source.toString().indexOf("pagination_dot_on") > -1, true);
88+ } else {
89+ compare(paginationDot.source.toString().indexOf("pagination_dot_off") > -1, true);
90+ }
91+ }
92+ }
93+ pageHeader.paginationIndex = -1;
94+ pageHeader.paginationCount = 0;
95+ tryCompare(paginationRepeater, "count", 0);
96+ }
97+
98 function test_popup_closing(data) {
99 searchEnabled = true;
100 pageHeader.searchHistory.clear();

Subscribers

People subscribed via source and target branches