3 import QtMobility.feedback 1.1
7 property alias currentLine: inputLine.text
11 /* List of available lines - will be filled w/ real data by LineSheet */
12 property variant availableLines: ['59A', '63A', '58']
14 property variant matches: availableLines
17 if (matches !== undefined) {
18 if (matches.length == 1) {
19 inputLine.text = matches[0];
25 function getMatches(prefix) {
28 for (var i in availableLines) {
29 var line = availableLines[i];
30 if (line.indexOf(prefix) == 0) {
45 * Ideally we would use ThemeEffect here,
46 * but on Harmattan it has no effect (sic)
59 horizontalAlignment: Text.AlignHCenter
60 verticalAlignment: Text.AlignVCenter
69 pixelSize: height * .9
76 linePad.matches = linePad.getMatches(text);
78 linePad.matches = linePad.availableLines;
83 source: 'image://theme/icon-m-toolbar-backspace'
85 verticalCenter: parent.verticalCenter
96 buttonFeedback.start()
105 property bool isMetro: inputLine.text[0] == 'U'
109 model: [1,2,3, 4,5,6, 7,8,9, 'A',0,'B', 'D','U','VRT', 'O','N','WLB']
113 property variant ch: modelData
114 property bool isCandidate
117 for (var i in linePad.matches) {
118 if (ch == matches[i][inputLine.text.length]) {
120 } else if ((ch == 'VRT' || ch == 'WLB') && inputLine.text == '') {
128 opacity: isCandidate?1:.15
129 Behavior on opacity { PropertyAnimation { } }
132 if (inputState.isMetro) {
134 case 1: return '#E20A16';
135 case 2: return '#764785';
136 case 3: return '#F76013';
137 case 4: return '#008131';
138 case 6: return '#88471F';
141 return (index%2?'#ddd':'#eee');
143 width: parent.width/3
144 height: (parent.height-inputLine.height)/6
146 y: inputLine.height + height*parseInt(index/3)
149 source: 'ubahnicon.png'
151 horizontalCenter: parent.horizontalCenter
152 bottom: parent.bottom
154 visible: (inputElement.ch === 'U')
159 visible: (inputElement.ch !== 'U')
160 anchors.centerIn: parent
163 pixelSize: parent.height * .5
167 if (inputState.isMetro || ch == 'U') {
169 } else if (inputElement.isCandidate) {
180 if( inputElement.isCandidate) {
181 buttonFeedback.start()
182 inputLine.text += modelData