6 property alias currentLine: inputLine.text
8 /* List of available lines - will be filled w/ real data by LineSheet */
9 property variant availableLines: ['59A', '63A', '58']
11 property variant matches: availableLines
14 if (matches !== undefined) {
15 if (matches.length == 1) {
16 inputLine.text = matches[0];
21 function getMatches(prefix) {
24 for (var i in availableLines) {
25 var line = availableLines[i];
26 if (line.indexOf(prefix) == 0) {
39 horizontalAlignment: Text.AlignHCenter
40 verticalAlignment: Text.AlignVCenter
49 pixelSize: height * .9
56 linePad.matches = linePad.getMatches(text);
58 linePad.matches = linePad.availableLines;
63 source: 'image://theme/icon-m-toolbar-backspace'
65 verticalCenter: parent.verticalCenter
73 margins: -(inputLine.height - height)/2
75 onClicked: inputLine.text = ''
82 property bool isMetro: inputLine.text[0] == 'U'
86 model: [1,2,3, 4,5,6, 7,8,9, 'A',0,'B', 'D','U','VRT', 'O','N','WLB']
90 property variant ch: modelData
91 property bool isCandidate
94 for (var i in linePad.matches) {
95 if (ch == matches[i][inputLine.text.length]) {
97 } else if ((ch == 'VRT' || ch == 'WLB') && inputLine.text == '') {
105 opacity: isCandidate?1:.15
106 Behavior on opacity { PropertyAnimation { } }
109 if (inputState.isMetro) {
111 case 1: return '#E20A16';
112 case 2: return '#764785';
113 case 3: return '#F76013';
114 case 4: return '#008131';
115 case 6: return '#88471F';
118 return (index%2?'#ddd':'#eee');
120 width: parent.width/3
121 height: (parent.height-inputLine.height)/6
123 y: inputLine.height + height*parseInt(index/3)
126 anchors.centerIn: parent
129 pixelSize: parent.height * .5
133 if (inputState.isMetro) {
135 } else if (inputElement.isCandidate) {
146 inputLine.text += modelData