@@ -38,6 +38,7 @@ Item {
38 property string lastSelectedApplication
38 property string lastSelectedApplication
40 onLauncherApplicationSelected: {
40 onLauncherApplicationSelected: {
41+ print("sleected", appId)
41 lastSelectedApplication = appId
42 lastSelectedApplication = appId
@@ -363,25 +364,60 @@ Item {
363 var draggedItem = findChild(launcher, "launcherDelegate5")
364 var draggedItem = findChild(launcher, "launcherDelegate5")
364 var item0 = findChild(launcher, "launcherDelegate0")
365 var item0 = findChild(launcher, "launcherDelegate0")
365 var fakeDragItem = findChild(launcher, "fakeDragItem")
366 var fakeDragItem = findChild(launcher, "fakeDragItem")
366− var dndArea = findChild(launcher, "dndArea")
367+ var quickListShape = findChild(launcher, "quickListShape")
368 // Initial state
369 // Initial state
369− compare(dndArea.quickListPopover, null)
370+ compare(quickListShape.visible, false)
371 // Doing longpress
372 // Doing longpress
372 mousePress(draggedItem, draggedItem.width / 2, draggedItem.height / 2)
373 mousePress(draggedItem, draggedItem.width / 2, draggedItem.height / 2)
373 tryCompare(fakeDragItem, "visible", true) // Wait longpress happening
374 tryCompare(fakeDragItem, "visible", true) // Wait longpress happening
374− verify(dndArea.quickListPopover != null)
375+ tryCompare(quickListShape, "visible", true)
376 // Dragging a bit (> 1.5 gu)
377 // Dragging a bit (> 1.5 gu)
377 mouseMove(draggedItem, -units.gu(2), draggedItem.height / 2)
378 mouseMove(draggedItem, -units.gu(2), draggedItem.height / 2)
379 // QuickList needs to be closed when a drag operation starts
380 // QuickList needs to be closed when a drag operation starts
380− tryCompare(dndArea, "quickListPopover", null)
381+ tryCompare(quickListShape, "visible", false)
382 mouseRelease(draggedItem);
383 mouseRelease(draggedItem);
386+ function test_quicklist_positioning_data() {
388+ {tag: "top", flickTo: "top", itemIndex: 0},
389+ {tag: "bottom", flickTo: "bottom", itemIndex: 9}
393+ function test_quicklist_positioning(data) {
394+ revealer.dragLauncherIntoView();
395+ var quickList = findChild(launcher, "quickList")
396+ var draggedItem = findChild(launcher, "launcherDelegate" + data.itemIndex)
397+ var quickListShape = findChild(launcher, "quickListShape")
399+ // Position launcher to where we need it
400+ var listView = findChild(launcher, "launcherListView");
401+ listView.flick(0, units.gu(200) * (data.flickTo === "top" ? 1 : -1));
402+ tryCompare(listView, "flicking", false);
405+ mousePress(draggedItem, draggedItem.width / 2, draggedItem.height / 2)
406+ tryCompare(quickListShape, "opacity", 0.8)
407+ mouseRelease(draggedItem);
409+ verify(quickList.y >= units.gu(1))
410+ verify(quickList.y + quickList.height + units.gu(1) <= launcher.height)
412+ // Click somewhere in the empty space to dismiss the quicklist
413+ mouseClick(launcher, launcher.width - units.gu(1), units.gu(1));
414+ tryCompare(quickListShape, "visible", false)
416+ // Click somewhere in the empty space to dismiss the launcher
417+ mouseClick(launcher, launcher.width - units.gu(1), units.gu(1));
418+ revealer.waitUntilLauncherDisappears()
385 function test_quicklist_click_data() {
421 function test_quicklist_click_data() {
387 {tag: "non-clickable", index: 1, clickable: false },
423 {tag: "non-clickable", index: 1, clickable: false },
@@ -392,19 +428,20 @@ Item {
392 function test_quicklist_click(data) {
428 function test_quicklist_click(data) {
393 revealer.dragLauncherIntoView();
429 revealer.dragLauncherIntoView();
394 var clickedItem = findChild(launcher, "launcherDelegate5")
430 var clickedItem = findChild(launcher, "launcherDelegate5")
395− var dndArea = findChild(launcher, "dndArea")
431+ var quickList = findChild(launcher, "quickList")
432+ var quickListShape = findChild(launcher, "quickListShape")
397 // Initial state
434 // Initial state
398− compare(dndArea.quickListPopover, null)
435+ tryCompare(quickListShape, "visible", false)
400 // Doing longpress
437 // Doing longpress
401 mousePress(clickedItem, clickedItem.width / 2, clickedItem.height / 2)
438 mousePress(clickedItem, clickedItem.width / 2, clickedItem.height / 2)
402 tryCompare(clickedItem, "itemOpacity", 0) // Wait for longpress to happen
439 tryCompare(clickedItem, "itemOpacity", 0) // Wait for longpress to happen
403− verify(dndArea.quickListPopover != null)
440+ verify(quickListShape.visible, "QuickList must be visible")
405 mouseRelease(clickedItem);
442 mouseRelease(clickedItem);
407− var quickListEntry = findChild(dndArea.quickListPopover, "quickListEntry" + data.index)
444+ var quickListEntry = findChild(quickList, "quickListEntry" + data.index)
409 signalSpy.clear();
446 signalSpy.clear();
410 signalSpy.signalName = "quickListTriggered"
447 signalSpy.signalName = "quickListTriggered"
@@ -413,7 +450,7 @@ Item {
414 if (data.clickable) {
451 if (data.clickable) {
415 // QuickList needs to be closed when some clickable item is clicked
452 // QuickList needs to be closed when some clickable item is clicked
416− tryCompare(dndArea, "quickListPopover", null)
453+ tryCompare(quickListShape, "visible", false)
418 compare(signalSpy.count, 1, "Quicklist signal wasn't triggered")
455 compare(signalSpy.count, 1, "Quicklist signal wasn't triggered")
419 compare(signalSpy.signalArguments[0][0], LauncherModel.get(5).appId)
456 compare(signalSpy.signalArguments[0][0], LauncherModel.get(5).appId)
@@ -422,13 +459,13 @@ Item {
424 // QuickList must not be closed when a non-clickable item is clicked
461 // QuickList must not be closed when a non-clickable item is clicked
425− verify(dndArea.quickListPopover != null)
462+ verify(quickListShape.visible, "QuickList must be visible")
427 compare(signalSpy.count, 0, "Quicklist signal must NOT be triggered when clicking a non-clickable item")
464 compare(signalSpy.count, 0, "Quicklist signal must NOT be triggered when clicking a non-clickable item")
429 // Click somewhere in the empty space to dismiss the quicklist
466 // Click somewhere in the empty space to dismiss the quicklist
430 mouseClick(launcher, launcher.width - units.gu(1), units.gu(1));
467 mouseClick(launcher, launcher.width - units.gu(1), units.gu(1));
431− tryCompare(dndArea, "quickListPopover", null)
468+ tryCompare(quickListShape, "visible", false)