2024-05-31 12:10:00 +01:00
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Controls
|
|
|
|
|
2024-06-04 21:10:39 +01:00
|
|
|
import roulette /* this is importing the target "roulette-payout" defined in CMakeLists.txt */
|
2024-05-31 12:10:00 +01:00
|
|
|
|
2024-05-31 13:56:24 +01:00
|
|
|
Window {
|
2024-06-08 17:35:27 +01:00
|
|
|
maximumHeight: 500
|
|
|
|
maximumWidth: 1000
|
|
|
|
minimumHeight: 500
|
|
|
|
minimumWidth: 1000
|
2024-05-31 13:56:24 +01:00
|
|
|
title: "Roulette Payout"
|
|
|
|
visible: true
|
|
|
|
|
|
|
|
Pane {
|
|
|
|
anchors.fill: parent
|
2024-06-01 01:14:46 +01:00
|
|
|
|
2024-06-09 13:25:58 +01:00
|
|
|
/* Exists exclusively to remove focus from TextFields by clicking anywhere else on the screen */
|
2024-06-07 10:06:28 +01:00
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
|
|
|
onClicked: focus = true
|
|
|
|
}
|
|
|
|
|
2024-05-31 13:56:24 +01:00
|
|
|
PlayerAreaView {
|
|
|
|
id: playerAreaView
|
|
|
|
}
|
2024-06-01 01:14:46 +01:00
|
|
|
|
|
|
|
Roulette {
|
|
|
|
id: roulette
|
|
|
|
height: parent.height / 1.7
|
|
|
|
width: parent.width / 1.7
|
|
|
|
|
|
|
|
anchors{
|
|
|
|
top: parent.top
|
|
|
|
right: parent.right
|
|
|
|
}
|
|
|
|
}
|
2024-06-07 18:03:22 +01:00
|
|
|
|
|
|
|
Button {
|
2024-06-08 10:58:34 +01:00
|
|
|
id: payoutButton
|
2024-06-07 18:03:22 +01:00
|
|
|
onClicked: PlayerAreaModel.payout()
|
2024-06-08 12:55:29 +01:00
|
|
|
enabled: false
|
2024-06-07 18:03:22 +01:00
|
|
|
|
|
|
|
anchors {
|
|
|
|
left: roulette.left
|
|
|
|
bottom: parent.bottom
|
|
|
|
bottomMargin: 20
|
|
|
|
}
|
|
|
|
|
2024-06-08 12:55:29 +01:00
|
|
|
contentItem: Text {
|
|
|
|
text: "Payout"
|
|
|
|
font.pointSize: 15
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
|
|
|
|
color: {
|
|
|
|
if (enabled == true) {
|
|
|
|
"#000000"
|
|
|
|
} else {
|
|
|
|
"#555555"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-06-07 18:03:22 +01:00
|
|
|
background: Rectangle {
|
|
|
|
implicitWidth: 150
|
|
|
|
implicitHeight: 60
|
|
|
|
opacity: {
|
2024-06-09 13:25:58 +01:00
|
|
|
if (enabled == true && parent.pressed) {
|
|
|
|
0.5
|
|
|
|
} else if (enabled == true && parent.hovered) {
|
|
|
|
0.2
|
2024-06-07 18:03:22 +01:00
|
|
|
} else {
|
|
|
|
0.3
|
|
|
|
}
|
|
|
|
}
|
2024-06-08 12:55:29 +01:00
|
|
|
color: {
|
|
|
|
if (enabled == true) {
|
|
|
|
"#AAAAAA"
|
|
|
|
} else {
|
|
|
|
"#444444"
|
|
|
|
}
|
|
|
|
}
|
2024-06-07 18:03:22 +01:00
|
|
|
border.width: 0
|
|
|
|
}
|
2024-06-08 12:55:29 +01:00
|
|
|
|
|
|
|
Connections {
|
|
|
|
target: PlayerAreaModel
|
|
|
|
|
|
|
|
function onBetChanged() {
|
|
|
|
if (PlayerAreaModel.focusedPlayer == 0) {
|
|
|
|
payoutButton.enabled = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function onBetRemoved() {
|
|
|
|
if (PlayerAreaModel.focusedPlayer == 0) {
|
|
|
|
payoutButton.enabled = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-06-07 18:03:22 +01:00
|
|
|
}
|
2024-06-08 10:58:34 +01:00
|
|
|
|
|
|
|
Results {
|
|
|
|
}
|
2024-05-31 12:10:00 +01:00
|
|
|
}
|
|
|
|
}
|