1357
1357
function test_tooltip() {
1358
dragLauncherIntoView()
1358
launcher.lockedVisible = true;
1359
dragLauncherIntoView();
1360
var item = findChild(launcher, "launcherDelegate0")
1361
var tooltipShape = findChild(launcher, "tooltipShape")
1361
var item = findChild(launcher, "launcherDelegate0");
1362
var tooltipShape = findChild(launcher, "tooltipShape");
1363
1364
// Make sure we don't start the test with the mouse hovering the launcher
1364
mouseMove(root, root.width, root.height / 2)
1365
mouseMove(root, root.width, root.height / 2);
1366
1367
// Initial state
1367
compare(tooltipShape.visible, false)
1368
tryCompare(tooltipShape, "visible", false);
1369
1370
// Move the mouse on the launcher icon
1370
mouseMove(item, item.width / 2, item.height / 2)
1371
mouseMove(item, item.width / 2 + 1, item.height / 2)
1372
tryCompare(tooltipShape, "visible", true)
1371
mouseMove(item, item.width / 2, item.height / 2);
1372
mouseMove(item, item.width / 2 + 1, item.height / 2);
1373
tryCompare(tooltipShape, "visible", true);
1374
1375
// Move the mouse away
1375
mouseMove(root, root.width, root.height / 2)
1376
tryCompare(tooltipShape, "visible", false)
1376
mouseMove(root, root.width, root.height / 2);
1377
tryCompare(tooltipShape, "visible", false);
1379
function test_quicklist_dismiss_tooltip() {
1380
dragLauncherIntoView()
1380
function test_quicklist_dismisses_tooltip() {
1381
launcher.lockedVisible = true;
1382
dragLauncherIntoView();
1382
var item = findChild(launcher, "launcherDelegate0")
1383
var tooltipShape = findChild(launcher, "tooltipShape")
1384
var quickListShape = findChild(launcher, "quickListShape")
1384
var item = findChild(launcher, "launcherDelegate0");
1385
var tooltipShape = findChild(launcher, "tooltipShape");
1386
var quickListShape = findChild(launcher, "quickListShape");
1386
1388
// Make sure we don't start the test with the mouse hovering the launcher
1387
mouseMove(root, root.width, root.height / 2)
1389
mouseMove(root, root.width, root.height / 2);
1389
1391
// Initial state
1390
compare(tooltipShape.visible, false)
1392
var tooltip = findChild(launcher, "tooltip")
1392
tryCompare(tooltipShape, "visible", false);
1395
1394
// Move the mouse on the launcher icon
1396
mouseMove(item, item.width / 2, item.height / 2)
1397
mouseMove(item, item.width / 2 + 1, item.height / 2)
1398
tryCompare(tooltipShape, "visible", true)
1399
console.log(tooltip.state)
1395
mouseMove(item, item.width / 2, item.height / 2);
1396
mouseMove(item, item.width / 2 + 1, item.height / 2);
1397
tryCompare(tooltipShape, "visible", true);
1402
1399
// Right click to show the quicklist
1403
mouseClick(item, item.width / 2, item.height / 2, Qt.RightButton)
1404
tryCompare(quickListShape, "visible", true)
1406
console.log(tooltip.state)
1407
tryCompare(tooltipShape, "visible", false)
1400
mouseClick(item, item.width / 2, item.height / 2, Qt.RightButton);
1401
tryCompare(quickListShape, "visible", true);
1402
tryCompare(tooltipShape, "visible", false);
1404
// Left click hides the quicklist, tooltip is still dismissed
1405
mouseClick(item, item.width / 2, item.height / 2, Qt.LefftButton);
1406
tryCompare(quickListShape, "visible", false);
1407
tryCompare(tooltipShape, "visible", false);
1409
// Mouse motion should should show tooltip again
1410
mouseMove(item, item.width / 2, item.height / 2);
1411
mouseMove(item, item.width / 2 + 1, item.height / 2);
1412
tryCompare(tooltipShape, "visible", true);
1410
function test_click_dismiss_tooltip() {
1411
dragLauncherIntoView()
1415
function test_click_dismisses_tooltip() {
1416
launcher.lockedVisible = true;
1417
dragLauncherIntoView();
1413
var item = findChild(launcher, "launcherDelegate0")
1414
var tooltipShape = findChild(launcher, "tooltipShape")
1419
var item = findChild(launcher, "launcherDelegate0");
1420
var tooltipShape = findChild(launcher, "tooltipShape");
1416
1422
// Make sure we don't start the test with the mouse hovering the launcher
1417
mouseMove(root, root.width, root.height / 2)
1423
mouseMove(root, root.width, root.height / 2);
1419
1425
// Initial state
1420
compare(tooltipShape.visible, false)
1426
compare(tooltipShape.visible, false);
1422
1428
// Move the mouse on the launcher icon
1423
mouseMove(item, item.width / 2, item.height / 2)
1424
mouseMove(item, item.width / 2 + 1, item.height / 2)
1425
tryCompare(tooltipShape, "visible", true)
1429
mouseMove(item, item.width / 2, item.height / 2);
1430
mouseMove(item, item.width / 2 + 1, item.height / 2);
1431
tryCompare(tooltipShape, "visible", true);
1427
1433
// Left click should dismiss the tooltip
1428
mouseClick(item, item.width / 2, item.height / 2, Qt.LeftButton)
1429
tryCompare(tooltipShape, "visible", false)
1434
mouseClick(item, item.width / 2 + 1, item.height / 2, Qt.LeftButton);
1435
tryCompare(tooltipShape, "visible", false);
1437
// Mouse motion should should show tooltip again
1438
mouseMove(item, item.width / 2, item.height / 2);
1439
mouseMove(item, item.width / 2 + 1, item.height / 2);
1440
tryCompare(tooltipShape, "visible", true);