diff options
author | Grigorii Zimin <gzimin@luxoft.com> | 2019-12-12 18:37:33 +0300 |
---|---|---|
committer | Grigorii Zimin <gzimin@luxoft.com> | 2019-12-12 17:01:53 +0000 |
commit | 3b238e219858b46834449abcc445a89806bc65df (patch) | |
tree | 4cf7687c208b43522afa4d093f0a92e9e2414461 /imports_shared | |
parent | 6d5270dfe9f7c888fda4bd3c337f0b3585192e52 (diff) |
[sysui, cursor] add angleOffset for cursor
-- WARNING: config.qml is created for each application in case of MP mode
hence any changes are made inside config dynamically affect only its
own process
Change-Id: I4e86001543d4a4e0348ab3eb9edc16e4f71404f4
Reviewed-by: Egor Nemtsev <enemtsev@luxoft.com>
Diffstat (limited to 'imports_shared')
-rw-r--r-- | imports_shared/shared/utils/Config.qml | 1 | ||||
-rw-r--r-- | imports_shared/shared/utils/Cursor.qml | 5 | ||||
-rw-r--r-- | imports_shared/shared/utils/CursorManagement.qml | 2 | ||||
-rw-r--r-- | imports_shared/shared/utils/CursorManagementDummy.qml | 1 |
4 files changed, 9 insertions, 0 deletions
diff --git a/imports_shared/shared/utils/Config.qml b/imports_shared/shared/utils/Config.qml index 3059eac2..77cd7d2a 100644 --- a/imports_shared/shared/utils/Config.qml +++ b/imports_shared/shared/utils/Config.qml @@ -70,6 +70,7 @@ QtObject { } root.cursorLoaderSource = cursorLoader.source; } + property int cursorAngleOffset: 0 property string cursorLoaderSource: "" //"Guinea pig" loader.This is to prevent the endless warnings for //CursorNavigation plugin not installed when this is not available. Here is diff --git a/imports_shared/shared/utils/Cursor.qml b/imports_shared/shared/utils/Cursor.qml index 5d7f6bfe..00162780 100644 --- a/imports_shared/shared/utils/Cursor.qml +++ b/imports_shared/shared/utils/Cursor.qml @@ -54,6 +54,7 @@ import shared.utils 1.0 Loader { id: root + anchors.fill: parent source: Config.cursorLoaderSource @@ -78,6 +79,10 @@ Loader { } Binding { restoreMode: Binding.RestoreBinding; + target: item; property:"angleOffset"; value: Config.cursorAngleOffset; when: item; + } + Binding { + restoreMode: Binding.RestoreBinding; target: root; property:"hasCursor"; value: item.hasCursor; when: item; } diff --git a/imports_shared/shared/utils/CursorManagement.qml b/imports_shared/shared/utils/CursorManagement.qml index a1920787..ebfc174c 100644 --- a/imports_shared/shared/utils/CursorManagement.qml +++ b/imports_shared/shared/utils/CursorManagement.qml @@ -66,10 +66,12 @@ Item { property bool acceptsCursor: true property bool hasCursor: parent.CursorNavigation.hasCursor property bool pressed: false + property int angleOffset: 0 signal activated() signal pressAndHold() + CursorNavigation.angleOffset: root.angleOffset CursorNavigation.acceptsCursor: root.acceptsCursor CursorNavigation.trapsCursor: root.trapsCursor CursorNavigation.onActivated: { diff --git a/imports_shared/shared/utils/CursorManagementDummy.qml b/imports_shared/shared/utils/CursorManagementDummy.qml index 85f4375a..361fa5cc 100644 --- a/imports_shared/shared/utils/CursorManagementDummy.qml +++ b/imports_shared/shared/utils/CursorManagementDummy.qml @@ -57,6 +57,7 @@ Item { property bool hasCursor: false property bool trapsCursor: false property bool acceptsCursor: true + property int angleOffset: 0 signal activated() signal pressAndHold() |