63 lines
1.2 KiB
QML
63 lines
1.2 KiB
QML
|
import QtQuick
|
||
|
import QtQuick.Controls
|
||
|
|
||
|
import roulette
|
||
|
|
||
|
Dialog {
|
||
|
property alias input: input
|
||
|
required property int betType /* It wouldn't accept the type defined in PlayerAreaModel so I just used the int since that's what it is*/
|
||
|
required property int n
|
||
|
required property int squareX
|
||
|
required property int squareY
|
||
|
|
||
|
id: dialog
|
||
|
modal: true
|
||
|
height: 35
|
||
|
width: 80
|
||
|
|
||
|
TextField {
|
||
|
id: input
|
||
|
focus: true
|
||
|
|
||
|
anchors {
|
||
|
left: parent.left
|
||
|
right: gil.left
|
||
|
rightMargin: 5
|
||
|
top: parent.top
|
||
|
bottom: parent.bottom
|
||
|
}
|
||
|
|
||
|
onActiveFocusChanged: {
|
||
|
selectAll()
|
||
|
focus = true
|
||
|
}
|
||
|
onAccepted: {
|
||
|
dialog.accept()
|
||
|
}
|
||
|
}
|
||
|
|
||
|
Text {
|
||
|
id: gil
|
||
|
text: "g"
|
||
|
|
||
|
anchors {
|
||
|
right: parent.right
|
||
|
verticalCenter: input.verticalCenter
|
||
|
}
|
||
|
}
|
||
|
|
||
|
onActiveFocusChanged: {
|
||
|
dialog.x = 120 + squareX
|
||
|
dialog.y = 60 + squareY
|
||
|
}
|
||
|
|
||
|
onAccepted: {
|
||
|
PlayerAreaModel.bet(betType, n, input.text)
|
||
|
rouletteTable.numberOfBets += 1
|
||
|
}
|
||
|
|
||
|
onRejected: {
|
||
|
PlayerAreaModel.cancelBet(n)
|
||
|
}
|
||
|
}
|