on xenial help sign in
Rename dividerDots* to pagination*.

Remove some unused id.

commita8d7f84cc6e4082fc17cfb24ce50b6a5c3043701 authorYing-Chun Liu <paul.liu@canonical.com> dateThu 31 Jul 2014, 22:07 (12 years ago) parent9f6a37d
4 files changed+24−27
qml/Components/PageHeader.qml+6−9 qml/Dash/DashContent.qml+2−2 qml/Dash/GenericScopeView.qml+2−2 tests/qmltests/Components/tst_PageHeader.qml+14−14
qml/Components/PageHeader.qml+6−9
@@ -35,8 +35,8 @@ Item {
3535 property bool searchInProgress: false
3636
3737 property alias bottomItem: bottomContainer.children
38− property int dividerDotsCount: 0
39− property int dividerDotsIndex: -1
38+ property int paginationCount: 0
39+ property int paginationIndex: -1
4040
4141 // TODO We should use foreground for the icons
4242 // of the toolbar but unfortunately Action does not have
@@ -280,18 +280,15 @@ Item {
280280 }
281281
282282 Row {
283− id: dividerDotsRow
284− objectName: "dividerDotsRow"
285283 spacing: units.gu(.5)
286284 Repeater {
287− id: dividerDotsRepeater
288− objectName: "dividerDotsRepeater"
289− model: root.dividerDotsCount
285+ objectName: "paginationRepeater"
286+ model: root.paginationCount
290287 Image {
291− objectName: "dividerDots_" + index
288+ objectName: "paginationDots_" + index
292289 height: units.gu(1)
293290 width: height
294− source: (index == root.dividerDotsIndex) ? "graphics/dot_on.png" : "graphics/dot_off.png"
291+ source: (index == root.paginationIndex) ? "graphics/dot_on.png" : "graphics/dot_off.png"
295292 }
296293 }
297294 anchors {
qml/Dash/DashContent.qml+2−2
@@ -141,8 +141,8 @@ Item {
141141 item.scope = Qt.binding(function() { return scope })
142142 item.isCurrent = Qt.binding(function() { return visible && ListView.isCurrentItem })
143143 dashContent.scopeLoaded(item.scope.id)
144− item.dividerDotsCount = Qt.binding(function() { return dashContentList.count } )
145− item.dividerDotsIndex = Qt.binding(function() { return dashContentList.currentIndex } )
144+ item.paginationCount = Qt.binding(function() { return dashContentList.count } )
145+ item.paginationIndex = Qt.binding(function() { return dashContentList.currentIndex } )
146146 }
147147 Connections {
148148 target: isCurrent ? scope : null
qml/Dash/GenericScopeView.qml+2−2
@@ -33,8 +33,8 @@ FocusScope {
3333 property bool hasBackAction: false
3434 property bool enableHeightBehaviorOnNextCreation: false
3535 property var categoryView: categoryView
36− property alias dividerDotsCount: pageHeader.dividerDotsCount
37− property alias dividerDotsIndex: pageHeader.dividerDotsIndex
36+ property alias paginationCount: pageHeader.paginationCount
37+ property alias paginationIndex: pageHeader.paginationIndex
3838
3939 property var scopeStyle: ScopeStyle {
4040 style: scope ? scope.customizations : {}
tests/qmltests/Components/tst_PageHeader.qml+14−14
@@ -175,25 +175,25 @@ Item {
175175 ];
176176 }
177177
178− function test_divider_dots() {
179− var dividerDotsRepeater = findChild(pageHeader, "dividerDotsRepeater");
180− tryCompare(dividerDotsRepeater, "count", 0);
181− pageHeader.dividerDotsCount = 5;
182− tryCompare(dividerDotsRepeater, "count", 5);
183− for (var i=0; i<pageHeader.dividerDotsCount; i++) {
184− pageHeader.dividerDotsIndex = i;
185− for (var j=0; j<dividerDotsRepeater.count; j++) {
186− var dividerDot = findChild(pageHeader, "dividerDots_"+j);
178+ function test_pagination() {
179+ var paginationRepeater = findChild(pageHeader, "paginationRepeater");
180+ tryCompare(paginationRepeater, "count", 0);
181+ pageHeader.paginationCount = 5;
182+ tryCompare(paginationRepeater, "count", 5);
183+ for (var i=0; i<pageHeader.paginationCount; i++) {
184+ pageHeader.paginationIndex = i;
185+ for (var j=0; j<paginationRepeater.count; j++) {
186+ var paginationDot = findChild(pageHeader, "paginationDots_"+j);
187187 if (i==j) {
188− compare(dividerDot.source.toString().indexOf("dot_on") > -1, true);
188+ compare(paginationDot.source.toString().indexOf("dot_on") > -1, true);
189189 } else {
190− compare(dividerDot.source.toString().indexOf("dot_off") > -1, true);
190+ compare(paginationDot.source.toString().indexOf("dot_off") > -1, true);
191191 }
192192 }
193193 }
194− pageHeader.dividerDotsIndex = -1;
195− pageHeader.dividerDotsCount = 0;
196− tryCompare(dividerDotsRepeater, "count", 0);
194+ pageHeader.paginationIndex = -1;
195+ pageHeader.paginationCount = 0;
196+ tryCompare(paginationRepeater, "count", 0);
197197 }
198198
199199 function test_tap_outside_closes_popup(data) {