symbols: qml: add missing special character
[src/qtquickcontrols2-agl.git] / imports / agl-demo-controls / Symbols.qml
1 /*
2  * Copyright (C) 2016 The Qt Company Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 import QtQuick 2.6
18 import QtQuick.Window 2.0
19 import QtQuick.Layouts 1.1
20
21 AbstractKeyboard {
22     id: root
23
24     ColumnLayout {
25         anchors.fill: parent
26         anchors.margins: root.height / 10
27         RowLayout {
28             Layout.fillWidth: true
29             Layout.fillHeight: true
30             Repeater {
31                 model: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0']
32                 delegate: Key {
33                     text: model.modelData
34                     Layout.preferredWidth: 2
35                     Layout.fillWidth: true
36                     Layout.fillHeight: true
37                 }
38             }
39         }
40         RowLayout {
41             Layout.fillWidth: true
42             Layout.fillHeight: true
43             Item {
44                 Layout.preferredWidth: 1
45                 Layout.fillWidth: true
46             }
47
48             Repeater {
49                 model: ['?', '#', '%', '&', '*', '-', '_', '+', '(', ')']
50                 delegate: Key {
51                     text: model.modelData
52                     Layout.preferredWidth: 2
53                     Layout.fillWidth: true
54                     Layout.fillHeight: true
55                 }
56             }
57             Item {
58                 Layout.preferredWidth: 1
59                 Layout.fillWidth: true
60             }
61         }
62         RowLayout {
63             Layout.fillWidth: true
64             Layout.fillHeight: true
65             Key {
66                 id: shift
67                 image: './images/Keyboard_Shift.svg'
68                 checkable: true
69                 Layout.preferredWidth: 2
70                 Layout.fillWidth: true
71                 Layout.fillHeight: true
72             }
73             Repeater {
74                 model: ['!', '"', '<', '>', '\'', ':', ';', '/']
75                 delegate: Key {
76                     text: model.modelData
77                     Layout.preferredWidth: 2
78                     Layout.fillWidth: true
79                     Layout.fillHeight: true
80                     capital: shift.checked
81                 }
82             }
83             Key {
84                 image: './images/Keyboard_Back.svg'
85                 Layout.preferredWidth: 2
86                 Layout.fillWidth: true
87                 Layout.fillHeight: true
88                 onClicked: {
89                     if (!clearSelctedText()) {
90                         var input = keyboard.target
91                         if (input.cursorPosition > 0)
92                             keyboard.target.remove(input.cursorPosition - 1, input.cursorPosition)
93                     }
94                 }
95             }
96         }
97         RowLayout {
98             Layout.fillWidth: true
99             Layout.fillHeight: true
100             Key {
101                 text: 'ABC'
102                 Layout.preferredWidth: 2
103                 Layout.fillWidth: true
104                 Layout.fillHeight: true
105                 onClicked: root.toggleMode()
106             }
107             Key {
108                 text: '.'
109                 Layout.preferredWidth: 2
110                 Layout.fillWidth: true
111                 Layout.fillHeight: true
112             }
113             Key {
114                 text: ' '
115                 image: './images/Keyboard_Space.svg'
116                 Layout.preferredWidth: 12
117                 Layout.fillWidth: true
118                 Layout.fillHeight: true
119             }
120             Key {
121                 text: '!?'
122                 Layout.preferredWidth: 2
123                 Layout.fillWidth: true
124                 Layout.fillHeight: true
125                 onClicked: root.toggleMode()
126             }
127             Key {
128                 image: './images/Keyboard_Arrow.svg'
129                 Layout.preferredWidth: 2
130                 Layout.fillWidth: true
131                 Layout.fillHeight: true
132                 onClicked: {
133                     root.hide()
134                 }
135             }
136         }
137     }
138 }