@@ -57,8 +57,25 @@ PanelTest {
57 minimizedPanelHeight: units.gu(3)
57 minimizedPanelHeight: units.gu(3)
58 expandedPanelHeight: units.gu(7)
58 expandedPanelHeight: units.gu(7)
59 openedHeight: parent.height
59 openedHeight: parent.height
60− indicatorsModel: root.indicatorsModel
60+ model: root.indicatorsModel
61 shown: false
61 shown: false
63+ rowItemDelegate: Item {
64+ property int ownIndex: index
65+ objectName: model.identifier + "-panelItem"
67+ implicitWidth: indicatorsMenu.expanded ? units.gu(5) : units.gu(3)
68+ height: parent.height
76+ Label { anchors.centerIn: parent; text: ownIndex }
@@ -205,8 +222,8 @@ PanelTest {
205 // tests swiping on an indicator item activates the correct item.
222 // tests swiping on an indicator item activates the correct item.
206 function test_swipeForCurrentItem()
223 function test_swipeForCurrentItem()
208− var indicatorItemRow = findChild(indicatorsMenu, "indicatorItemRow");
225+ var panelItemRow = findChild(indicatorsMenu, "panelItemRow");
209− verify(indicatorItemRow !== null);
226+ verify(panelItemRow !== null);
211 for (var i = 0; i < root.originalModelData.length; i++) {
228 for (var i = 0; i < root.originalModelData.length; i++) {
212 var indicatorItem = get_indicator_item(i);
229 var indicatorItem = get_indicator_item(i);
@@ -218,10 +235,10 @@ PanelTest {
218 mappedPosition.x, indicatorsMenu.openedHeight / 2,
235 mappedPosition.x, indicatorsMenu.openedHeight / 2,
219 true /* beginTouch */, false /* endTouch */);
236 true /* beginTouch */, false /* endTouch */);
221− tryCompare(indicatorItemRow, "currentItem", indicatorItem, undefined /*timeout, default */,
238+ tryCompare(panelItemRow, "currentItem", indicatorItem, undefined /*timeout, default */,
222 "Incorrect item activated at position " + i);
239 "Incorrect item activated at position " + i);
224− touchFlick(indicatorItemRow,
241+ touchFlick(panelItemRow,
225 mappedPosition.x, indicatorsMenu.openedHeight / 2,
242 mappedPosition.x, indicatorsMenu.openedHeight / 2,
226 mappedPosition.x, mappedPosition.y,
243 mappedPosition.x, mappedPosition.y,
227 false /* beginTouch */, true /* endTouch */);
244 false /* beginTouch */, true /* endTouch */);
@@ -238,8 +255,8 @@ PanelTest {
238 indicatorsMenu.verticalVelocityThreshold = 0;
255 indicatorsMenu.verticalVelocityThreshold = 0;
239 verify(root.originalModelData.length >= 2);
256 verify(root.originalModelData.length >= 2);
241− var indicatorItemRow = findChild(indicatorsMenu, "indicatorItemRow");
258+ var panelItemRow = findChild(indicatorsMenu, "panelItemRow");
242− verify(indicatorItemRow !== null);
259+ verify(panelItemRow !== null);
244 // Get the first indicator
261 // Get the first indicator
245 var firstItem = get_indicator_item(0);
262 var firstItem = get_indicator_item(0);
@@ -251,12 +268,14 @@ PanelTest {
251 firstItemMappedPosition.x, indicatorsMenu.minimizedPanelHeight * 2,
268 firstItemMappedPosition.x, indicatorsMenu.minimizedPanelHeight * 2,
252 true /* beginTouch */, false /* endTouch */);
269 true /* beginTouch */, false /* endTouch */);
254− tryCompare(indicatorItemRow, "currentItem", firstItem)
271+ tryCompare(panelItemRow, "currentItem", firstItem)
256 // next time position will have moved.
273 // next time position will have moved.
257 var nextItem = get_indicator_item(1);
274 var nextItem = get_indicator_item(1);
258 var nextItemMappedPositionX = firstItemMappedPosition.x + firstItem.width;
275 var nextItemMappedPositionX = firstItemMappedPosition.x + firstItem.width;
277+ firstItemMappedPosition = indicatorsMenu.mapFromItem(firstItem, firstItem.width/2, firstItem.height/2);
260 // 1) Flick mouse down to bottom
279 // 1) Flick mouse down to bottom
261 touchFlick(indicatorsMenu,
280 touchFlick(indicatorsMenu,
262 firstItemMappedPosition.x, indicatorsMenu.minimizedPanelHeight * 2,
281 firstItemMappedPosition.x, indicatorsMenu.minimizedPanelHeight * 2,
@@ -264,10 +283,10 @@ PanelTest {
264 false /* beginTouch */, false /* endTouch */,
283 false /* beginTouch */, false /* endTouch */,
265 units.gu(50) /* speed */, 5 /* iterations */); // more samples needed for accurate velocity
284 units.gu(50) /* speed */, 5 /* iterations */); // more samples needed for accurate velocity
267− tryCompare(indicatorItemRow, "currentItem", firstItem, undefined /* timeout, default */,
286+ tryCompare(panelItemRow, "currentItem", firstItem, undefined /* timeout, default */,
268 "First indicator should still be the current item");
287 "First indicator should still be the current item");
269 // after waiting in the same spot with touch down, it should update to the next item.
288 // after waiting in the same spot with touch down, it should update to the next item.
270− tryCompare(indicatorItemRow, "currentItem", nextItem);
289+ tryCompare(panelItemRow, "currentItem", nextItem);
272 touchRelease(indicatorsMenu, nextItemMappedPositionX, indicatorsMenu.openedHeight / 3);
291 touchRelease(indicatorsMenu, nextItemMappedPositionX, indicatorsMenu.openedHeight / 3);