roulette-payout/BetInputDialog.qml
greek c2e9d6ff7d Big commit.
Added indicator showing selected Player.
Added maximum of two bets.
When selecting a different player, his current bets will now be shown.
Creating dialog box for bet input dynamically.
2024-06-02 21:13:43 +01:00

62 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)
}
}