brmbarv3 BarKeyboard: Allow keyboard text entry; use in ChargeCredit

This commit is contained in:
Petr Baudis 2012-10-16 19:36:49 +02:00
parent 0801bc24cb
commit a5ffdf27e8
2 changed files with 16 additions and 3 deletions

View file

@ -8,7 +8,7 @@ Item {
property variant username: ""
property variant userdbid: ""
property variant amount: ""
property variant amount: credit_pad.enteredText
Text {
id: item_name
@ -49,12 +49,14 @@ Item {
x: 65
y: 195
visible: parent.username != ""
onLetterEntered: { amount = amount.toString() + letter; }
onLetterBackspace: { amount = amount.toString().replace(/.$/, ''); }
focus: parent.username != ""
Keys.onReturnPressed: { charge_button.buttonClick() }
Keys.onEscapePressed: { cancel.buttonClick() }
}
BarcodeInput {
color: "#00ff00" /* just for debugging */
focus: parent.username == ""
onAccepted: {
var acct = shop.barcodeInput(text)
text = ""