diff options
author | Antti Hölttä <AHoelttae@luxoft.com> | 2018-12-05 15:41:52 +0100 |
---|---|---|
committer | Antti Hölttä <AHoelttae@luxoft.com> | 2019-03-18 16:34:23 +0100 |
commit | 726f0bca0d50a86ff30a367cbdd2f31190fcd30c (patch) | |
tree | fd04bf5d92f2f25d317a12af5f29a47d986f6062 /DemoApplication/pages/Page4.qml | |
parent | ff7c7152388889da7d603b207e575e366873186d (diff) |
Add callbacks for magnitude, moves and actions
When cursor is moved, the current item is informed of the actions
via callbacks. Eg. when cursor is moved up, the item that had the
cursor will have its movedUp signal fired. It is now also possible
to inform navigable items over incomplete movement, or the magnitude
of the movement. This may be used eg. to make buttons or elements to
flip/rotate to indicate that the cursor is about to be moved.
Diffstat (limited to 'DemoApplication/pages/Page4.qml')
-rw-r--r-- | DemoApplication/pages/Page4.qml | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/DemoApplication/pages/Page4.qml b/DemoApplication/pages/Page4.qml index a77ce7b..47828dd 100644 --- a/DemoApplication/pages/Page4.qml +++ b/DemoApplication/pages/Page4.qml @@ -30,7 +30,8 @@ Item { parent.CursorNavigation.move(Qt.vector2d(axisLeftX, axisLeftY), 10) cooldownTimer.start() } else if (v.length() >= 0.1) { - var item = parent.CursorNavigation.find(Qt.vector2d(axisLeftX, axisLeftY), 10) + parent.CursorNavigation.setMagnitude(v) + var item = parent.CursorNavigation.find(v, 10) //cooldownTimer.start() if (item != undefined) { pointerRect.x = item.x @@ -40,6 +41,7 @@ Item { pointerRect.visible = true } } else { + parent.CursorNavigation.setMagnitude(0,0) pointerRect.visible = false } } |