diff options
author | Alexandra Betouni <ABetouni@luxoft.com> | 2018-11-20 12:49:37 +0100 |
---|---|---|
committer | Antti Hölttä <AHoelttae@luxoft.com> | 2019-03-18 16:32:22 +0100 |
commit | d87734d37a0c9689647b4eaaef1eeda318c3f8be (patch) | |
tree | 59e61cc9e9ddbf888bd0ab5964185cace219eb6a /DemoApplication/pages/Page3.qml | |
parent | 4e53c46500bdbe9f6fd7228f14b27fb7262b0350 (diff) |
Demo application clean up
Minor improvements in pro file for demo app
Also update .gitignore to ignore DS_Store files
Removed unecessary code and files
Diffstat (limited to 'DemoApplication/pages/Page3.qml')
-rw-r--r-- | DemoApplication/pages/Page3.qml | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/DemoApplication/pages/Page3.qml b/DemoApplication/pages/Page3.qml new file mode 100644 index 0000000..ece6975 --- /dev/null +++ b/DemoApplication/pages/Page3.qml @@ -0,0 +1,93 @@ +import QtQuick 2.0 + +import CursorNavigation 1.0 +import "../controls" + +Item { + width: parent.width + height: parent.height + + FocusScope { + id: rootScope + anchors.fill: parent + Row { + anchors.centerIn: parent + spacing: 10 + CNButton { + width: 100 + height: 100 + text: "alone!" + } + + Grid { + columns: 2 + rows: 2 + spacing: 5 + + CNButton { + text: "b1" + } + + CNButton { + text: "b2 (default focus)" + focus: true + } + + CNButton { + id: defaultButton + text: "b3 (escape target)" + } + + CNButton { + text: "b4" + } + } + + Rectangle { + width: 250 + height: 200 + + border.width: 2 + border.color: "grey" + + FocusScope { + anchors.fill: parent + CursorNavigation.acceptsCursor: true + CursorNavigation.escapeTarget: defaultButton + + //redefine the controls for this scope + //(default arrow keys will still work as well, unless reassigned here) + Keys.onDigit5Pressed: CursorNavigation.moveUp() + Keys.onDigit2Pressed: CursorNavigation.moveDown() + Keys.onDigit3Pressed: CursorNavigation.moveRight() + Keys.onDigit1Pressed: CursorNavigation.moveLeft() + + Grid { + spacing: 5 + columns: 2 + rows: 2 + + CNButton { + text: "sb1" + } + + CNButton { + text: "sb2" + } + + CNButton { + text: "sb3" + } + + CNButton { + text: "sb4 (default focus)" + focus: true + } + } + } + } + } + //this seems to be the way to force focus on a newly opened dialog? + Component.onCompleted: { forceActiveFocus(); } + } +} |