@@ -28,8 +28,8 @@ import Utils 0.1 // For EdgeBarrierSettings
2828 launcher. */
2929Item {
3030 id: root
31− width: units.gu(50)
32− height: units.gu(55)
31+ width: units.gu(140)
32+ height: units.gu(70)
3333
3434 Loader {
3535 id: launcherLoader
@@ -79,11 +79,40 @@ Item {
7979 }
8080 }
8181
82+ Binding {
83+ target: launcherLoader.item
84+ property: "lockedVisible"
85+ value: lockedVisibleCheckBox.checked
86+ }
87+ Binding {
88+ target: launcherLoader.item
89+ property: "panelWidth"
90+ value: units.gu(Math.round(widthSlider.value))
91+ }
92+
8293 ColumnLayout {
8394 anchors { bottom: parent.bottom; right: parent.right; margins: units.gu(1) }
8495 spacing: units.gu(1)
8596 width: childrenRect.width
8697
98+ RowLayout {
99+ CheckBox {
100+ id: lockedVisibleCheckBox
101+ checked: false
102+ }
103+ Label {
104+ text: "Launcher always visible"
105+ }
106+ }
107+
108+ Slider {
109+ id: widthSlider
110+ Layout.fillWidth: true
111+ minimumValue: 6
112+ maximumValue: 12
113+ value: 10
114+ }
115+
87116 MouseTouchEmulationCheckbox {}
88117
89118 EdgeBarrierControls {
@@ -217,10 +246,6 @@ Item {
217246 // growing while populating it with icons etc.
218247 tryCompare(listView, "flicking", false);
219248
220− // Make sure noone changed the height of the window. The issue this test case
221− // is verifying only happens on certain heights of the Launcher
222− compare(root.height, units.gu(55));
223−
224249 compare(listView.contentY, -listView.topMargin, "Launcher did not start up with first item unfolded");
225250
226251 // Now do check that snapping is in fact enabled
@@ -277,23 +302,31 @@ Item {
277302
278303 function positionLauncherListAtBeginning() {
279304 var listView = testCase.findChild(launcherLoader.item, "launcherListView");
280− listView.contentY = -listView.topMargin;
305+ var moveAnimation = findInvisibleChild(listView, "moveAnimation")
306+
307+ listView.moveToIndex(0);
308+
309+ waitForRendering(listView);
310+ tryCompare(moveAnimation, "running", false);
281311 }
282312 function positionLauncherListAtEnd() {
283313 var listView = testCase.findChild(launcherLoader.item, "launcherListView");
284− if ((listView.contentHeight + listView.topMargin + listView.bottomMargin) > listView.height) {
285− listView.contentY = listView.topMargin + listView.contentHeight
286− - listView.height;
287− }
314+ var moveAnimation = findInvisibleChild(listView, "moveAnimation")
315+
316+ listView.moveToIndex(listView.count -1);
317+
318+ waitForRendering(listView);
319+ tryCompare(moveAnimation, "running", false);
288320 }
289321
290322 function assertFocusOnIndex(index) {
291− var launcherPanel = findChild(launcherLoader.item, "launcherPanel");
292− var launcherListView = findChild(launcherLoader.item, "launcherListView");
293− var bfbFocusHighlight = findChild(launcherLoader.item, "bfbFocusHighlight");
294− waitForRendering(launcherLoader.item);
323+ var launcherPanel = findChild(launcher, "launcherPanel");
324+ var launcherListView = findChild(launcher, "launcherListView");
325+ var bfbFocusHighlight = findChild(launcher, "bfbFocusHighlight");
326+
327+ waitForRendering(launcher);
295328 tryCompare(launcherPanel, "highlightIndex", index);
296− tryCompare(bfbFocusHighlight, "visible", index === -1);
329+ compare(bfbFocusHighlight.visible, index === -1);
297330 for (var i = 0; i < launcherListView.count; i++) {
298331 var item = findChild(launcher, "launcherDelegate" + i);
299332 // Delegates might be destroyed when not visible. We can't check if they paint a focus highlight.
@@ -406,6 +439,7 @@ Item {
406439 wait(100)
407440 compare(launcher.maxPanelX, -launcher.panelWidth, "Launcher moved even if it shouldn't")
408441 }
442+
409443 waitUntilLauncherDisappears();
410444 launcher.available = true;
411445 }
@@ -429,6 +463,8 @@ Item {
429463 dragLauncherIntoView();
430464 var launcherListView = findChild(launcher, "launcherListView");
431465 for (var i = 0; i < launcherListView.count; ++i) {
466+ launcherListView.moveToIndex(i);
467+ waitForRendering(launcherListView);
432468 var delegate = findChild(launcherListView, "launcherDelegate" + i)
433469 compare(findChild(delegate, "countEmblem").visible, LauncherModel.get(i).countVisible)
434470 // Intentionally allow type coercion (string/number)
@@ -489,6 +525,7 @@ Item {
489525 launcher.lastSelectedApplication = "";
490526 dragLauncherIntoView();
491527 var listView = findChild(launcher, "launcherListView");
528+ var moveAnimation = findInvisibleChild(listView, "moveAnimation")
492529
493530 // flicking is unreliable. sometimes it works, sometimes the
494531 // list view moves just a tiny bit or not at all, making tests fail.
@@ -499,12 +536,14 @@ Item {
499536 } else {
500537 positionLauncherListAtEnd();
501538 }
502− tryCompare(listView, "flicking", false);
503−
504539 var oldY = listView.contentY;
505540
506541 mouseClick(listView, listView.width / 2, data.clickY);
507− tryCompare(listView, "flicking", false);
542+
543+ if (data.expectFlick) {
544+ tryCompare(moveAnimation, "running", true);
545+ }
546+ tryCompare(moveAnimation, "running", false);
508547
509548 if (data.expectFlick) {
510549 verify(listView.contentY != oldY);
@@ -1092,11 +1131,14 @@ Item {
10921131 function test_keyboardNavigation() {
10931132 var bfbFocusHighlight = findChild(launcher, "bfbFocusHighlight");
10941133 var quickList = findChild(launcher, "quickList");
1134+ var launcherPanel = findChild(launcher, "launcherPanel");
10951135 var launcherListView = findChild(launcher, "launcherListView");
10961136 var last = launcherListView.count - 1;
10971137
10981138 compare(bfbFocusHighlight.visible, false);
10991139 launcher.openForKeyboardNavigation();
1140+ tryCompare(launcherPanel, "x", 0);
1141+ waitForRendering(launcher);
11001142
11011143 assertFocusOnIndex(-1);
11021144
@@ -1173,11 +1215,47 @@ Item {
11731215 compare(signalSpy.count, 1, "Quicklist signal wasn't triggered")
11741216 compare(signalSpy.signalArguments[0][0], LauncherModel.get(1).appId)
11751217 compare(signalSpy.signalArguments[0][1], 2)
1218+ assertFocusOnIndex(-2);
1219+ }
1220+
1221+ function test_hideNotWorkingWhenLockedOut_data() {
1222+ return [
1223+ {tag: "locked visible", locked: true},
1224+ {tag: "no locked visible", locked: false},
1225+ ]
1226+ }
1227+
1228+ function test_hideNotWorkingWhenLockedOut(data) {
1229+ launcher.lockedVisible = data.locked;
1230+ if (data.locked) {
1231+ tryCompare(launcher, "state", "visible");
1232+ } else {
1233+ tryCompare(launcher, "state", "");
1234+ }
1235+
1236+ launcher.hide();
1237+ waitForRendering(launcher);
1238+ if (data.locked) {
1239+ verify(launcher.state == "visible");
1240+ } else {
1241+ verify(launcher.state == "");
1242+ }
11761243 }
11771244
1178− function test_cancelKbdNavigationWitMouse() {
1245+ function test_cancelKbdNavigationWitMouse_data() {
1246+ return [
1247+ {tag: "locked out - no quicklist", autohide: false, withQuickList: false },
1248+ {tag: "locked out - with quicklist", autohide: false, withQuickList: true },
1249+ {tag: "autohide - no quicklist", autohide: true, withQuickList: false },
1250+ {tag: "autohide - with quicklist", autohide: true, withQuickList: true },
1251+ ]
1252+ }
1253+
1254+ function test_cancelKbdNavigationWitMouse(data) {
1255+ launcher.autohideEnabled = data.autohide;
11791256 launcher.openForKeyboardNavigation();
11801257 waitForRendering(launcher);
1258+
11811259 var launcherPanel = findChild(launcher, "launcherPanel");
11821260 tryCompare(launcherPanel, "x", 0);
11831261
@@ -1185,15 +1263,22 @@ Item {
11851263
11861264 keyClick(Qt.Key_Down); // Down to launcher item 0
11871265 keyClick(Qt.Key_Down); // Down to launcher item 1
1188− keyClick(Qt.Key_Right); // Into quicklist
11891266
1267+ if (data.withQuickList) {
1268+ keyClick(Qt.Key_Right); // Into quicklist
1269+ tryCompare(quickList, "visible", true)
1270+ }
11901271 waitForRendering(launcher)
1191− tryCompare(quickList, "visible", true)
11921272
1193− mouseClick(root, root.width / 2, units.gu(2));
1273+ mouseClick(root);
11941274
1195− tryCompare(launcher, "state", "");
1196− tryCompare(launcherPanel, "highlightIndex", -2);
1275+ if (data.autohide) {
1276+ tryCompare(launcher, "state", "");
1277+ } else {
1278+ tryCompare(launcher, "state", "visible");
1279+ }
1280+
1281+ assertFocusOnIndex(-2);
11971282 }
11981283 }
11991284}