3 import QtMobility.feedback 1.1
7 property alias currentLine: inputLine.text
9 /* List of available lines - will be filled w/ real data by LineSheet */
10 property variant availableLines: ['59A', '63A', '58']
12 property variant matches: availableLines
15 if (matches !== undefined) {
16 if (matches.length == 1) {
17 inputLine.text = matches[0];
22 function getMatches(prefix) {
25 for (var i in availableLines) {
26 var line = availableLines[i];
27 if (line.indexOf(prefix) == 0) {
42 * Ideally we would use ThemeEffect here,
43 * but on Harmattan it has no effect (sic)
56 horizontalAlignment: Text.AlignHCenter
57 verticalAlignment: Text.AlignVCenter
66 pixelSize: height * .9
73 linePad.matches = linePad.getMatches(text);
75 linePad.matches = linePad.availableLines;
80 source: 'image://theme/icon-m-toolbar-backspace'
82 verticalCenter: parent.verticalCenter
90 margins: -(inputLine.height - height)/2
93 buttonFeedback.start()
102 property bool isMetro: inputLine.text[0] == 'U'
106 model: [1,2,3, 4,5,6, 7,8,9, 'A',0,'B', 'D','U','VRT', 'O','N','WLB']
110 property variant ch: modelData
111 property bool isCandidate
114 for (var i in linePad.matches) {
115 if (ch == matches[i][inputLine.text.length]) {
117 } else if ((ch == 'VRT' || ch == 'WLB') && inputLine.text == '') {
125 opacity: isCandidate?1:.15
126 Behavior on opacity { PropertyAnimation { } }
129 if (inputState.isMetro) {
131 case 1: return '#E20A16';
132 case 2: return '#764785';
133 case 3: return '#F76013';
134 case 4: return '#008131';
135 case 6: return '#88471F';
138 return (index%2?'#ddd':'#eee');
140 width: parent.width/3
141 height: (parent.height-inputLine.height)/6
143 y: inputLine.height + height*parseInt(index/3)
146 anchors.centerIn: parent
149 pixelSize: parent.height * .5
153 if (inputState.isMetro) {
155 } else if (inputElement.isCandidate) {
166 buttonFeedback.start()
167 inputLine.text += modelData