From 12f3f20be7e160b4f8de4ee267909fec61673111 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Wed, 5 Aug 2015 12:45:48 +0200 Subject: TapHandler: add timeHeld property MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It enables long-press gestures to have continuous feedback. Change-Id: Idd0838aff6213ebfc2fce66639bbc932e77208b4 Reviewed-by: Jan Arve Sæther --- tests/manual/pointer/tapHandler.qml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'tests/manual') diff --git a/tests/manual/pointer/tapHandler.qml b/tests/manual/pointer/tapHandler.qml index 2e45b1c369..06070a02ff 100644 --- a/tests/manual/pointer/tapHandler.qml +++ b/tests/manual/pointer/tapHandler.qml @@ -81,7 +81,7 @@ Item { } onLongPressed: longPressFeedback.createObject(rect, {"x": pos.x, "y": pos.y, - "text": "long press", + "text": Math.round(handler.timeHeld).toFixed(3) + " sec", "color": borderBlink.blinkColor}) } @@ -112,6 +112,20 @@ Item { } } + Rectangle { + id: expandingCircle + radius: handler.timeHeld * 100 + visible: radius > 0 && handler.isPressed + border.width: 3 + border.color: borderBlink.blinkColor + color: "transparent" + width: radius * 2 + height: radius * 2 + x: handler.pressPos.x - radius + y: handler.pressPos.y - radius + opacity: 0.25 + } + Component { id: longPressFeedback Text { } -- cgit v1.2.3