aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/controls
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-04-04 17:44:58 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2017-04-05 09:08:22 +0000
commit790cf8d3b4078dc1bbc1afb338f1bf197598c4d0 (patch)
tree5442ea4d144d0f76efa4904f4c1524485ce0c012 /tests/auto/controls
parent1cf6abc8ba5547f12352467db8ce1c3d09921960 (diff)
Dial: react immediately when using a mouse
The initial drag threshold is a necessary evil on touch to avoid conflicting with flickables, but leads to bad experience (QTBUG-47081) when using a mouse. Now that we have separate mouse and touch handling, we can apply immediate moves when using a mouse, but keep the old behavior on touch. Task-number: QTBUG-59920 Change-Id: I097cbdaed4933c0d907097b75f15ba16dcf615b1 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests/auto/controls')
-rw-r--r--tests/auto/controls/data/tst_dial.qml14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/auto/controls/data/tst_dial.qml b/tests/auto/controls/data/tst_dial.qml
index 98c3a002..3b20e91d 100644
--- a/tests/auto/controls/data/tst_dial.qml
+++ b/tests/auto/controls/data/tst_dial.qml
@@ -465,7 +465,7 @@ TestCase {
compare(dial.value, dial.to);
}
- function test_snapMode_data() {
+ function test_snapMode_data(immediate) {
return [
{ tag: "NoSnap", snapMode: Slider.NoSnap, from: 0, to: 2, values: [0, 0, 1], positions: [0, 0.5, 0.5] },
{ tag: "SnapAlways (0..2)", snapMode: Slider.SnapAlways, from: 0, to: 2, values: [0.0, 0.0, 1.0], positions: [0.0, 0.5, 0.5] },
@@ -474,13 +474,13 @@ TestCase {
{ tag: "SnapAlways (1..-1)", snapMode: Slider.SnapAlways, from: 1, to: -1, values: [1.0, 1.0, 0.0], positions: [0.0, 0.5, 0.5] },
{ tag: "SnapOnRelease (0..2)", snapMode: Slider.SnapOnRelease, from: 0, to: 2, values: [0.0, 0.0, 1.0], positions: [0.0, 0.5, 0.5] },
{ tag: "SnapOnRelease (1..3)", snapMode: Slider.SnapOnRelease, from: 1, to: 3, values: [1.0, 1.0, 2.0], positions: [0.0, 0.5, 0.5] },
- { tag: "SnapOnRelease (-1..1)", snapMode: Slider.SnapOnRelease, from: -1, to: 1, values: [0.0, 0.0, 0.0], positions: [0.5, 0.5, 0.5] },
+ { tag: "SnapOnRelease (-1..1)", snapMode: Slider.SnapOnRelease, from: -1, to: 1, values: [0.0, 0.0, 0.0], positions: [immediate ? 0.0 : 0.5, 0.5, 0.5] },
{ tag: "SnapOnRelease (1..-1)", snapMode: Slider.SnapOnRelease, from: 1, to: -1, values: [1.0, 1.0, 0.0], positions: [0.0, 0.5, 0.5] }
]
}
function test_snapMode_mouse_data() {
- return test_snapMode_data()
+ return test_snapMode_data(true)
}
function test_snapMode_mouse(data) {
@@ -492,11 +492,11 @@ TestCase {
dial.to = data.to;
dial.stepSize = 0.2;
- var fuzz = 0.05;
+ var fuzz = 0.055;
mousePress(dial, dial.width * 0.25, dial.height * 0.75);
- compare(dial.value, data.values[0]);
- compare(dial.position, data.positions[0]);
+ fuzzyCompare(dial.value, data.values[0], fuzz);
+ fuzzyCompare(dial.position, data.positions[0], fuzz);
mouseMove(dial, dial.width * 0.5, dial.height * 0.25);
fuzzyCompare(dial.value, data.values[1], fuzz);
@@ -508,7 +508,7 @@ TestCase {
}
function test_snapMode_touch_data() {
- return test_snapMode_data()
+ return test_snapMode_data(false)
}
function test_snapMode_touch(data) {