mirror of
https://github.com/brmlab/brmbar.git
synced 2025-06-08 13:24:01 +02:00
brmbar v3: Add support for numpad touch entry, use in charge and withdrawal screens
This commit is contained in:
parent
586b2411cf
commit
27f9b35b52
5 changed files with 81 additions and 45 deletions
39
brmbar3/brmbar-gui-qt4/BarKeyboard.qml
Normal file
39
brmbar3/brmbar-gui-qt4/BarKeyboard.qml
Normal file
|
@ -0,0 +1,39 @@
|
|||
import Qt 4.7
|
||||
|
||||
Grid {
|
||||
property string keys: ""
|
||||
property int gridRows: 0
|
||||
property int gridColumns: 0
|
||||
property int buttonWidth: 70
|
||||
property int buttonHeight: 70
|
||||
|
||||
property bool shift: false
|
||||
|
||||
signal letterBackspace()
|
||||
signal letterEntered(string letter)
|
||||
|
||||
rows: gridRows
|
||||
columns: gridColumns
|
||||
spacing: 1
|
||||
|
||||
Repeater {
|
||||
model: keys.length
|
||||
BarButton {
|
||||
width: buttonWidth; height: buttonHeight
|
||||
property string key: keys.charAt(index)
|
||||
property bool special: key == "^" || key == "<"
|
||||
|
||||
text: key == "^" ? "shift" : key == "<" ? "bksp" : shift ? key.toUpperCase() : key
|
||||
fontSize: special ? 20 : 44
|
||||
|
||||
onButtonClick: {
|
||||
if (key == "^")
|
||||
shift = !shift
|
||||
else if (key == "<")
|
||||
letterBackspace()
|
||||
else
|
||||
letterEntered(key)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue