roulette-payout/PlayerAreaView.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

65 lines
1.5 KiB
QML

import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import roulette
Item {
anchors {
left: parent.left
leftMargin: 10
}
Text {
id: croupier
text: "Croupier"
}
ColumnLayout {
anchors {
top: croupier.bottom
topMargin: 20
}
spacing: 60
Repeater {
model: 7
Item {
Text {
id: label
text: "Player " + (index + 1)
}
Rectangle {
id: indicator
color: "red"
height: 10
width: 10
visible: PlayerAreaModel.focusedPlayer == index
opacity: 0.5
anchors {
verticalCenter: inputField.verticalCenter
right: inputField.left
rightMargin: 5
}
}
TextField {
id: inputField
anchors.top: label.bottom
anchors.topMargin: 6
onTextEdited: PlayerAreaModel.setPlayerName(text, index)
onActiveFocusChanged: {
if (activeFocus && (focusReason == 0 || focusReason == 1 || focusReason == 2)) {
PlayerAreaModel.focusedPlayer = index
}
}
}
}
}
}
}