roulette-payout/Root.qml

107 lines
2.7 KiB
QML
Raw Normal View History

import QtQuick
import QtQuick.Controls
import roulette /* this is importing the target "roulette-payout" defined in CMakeLists.txt */
Window {
maximumHeight: 500
maximumWidth: 1000
minimumHeight: 500
minimumWidth: 1000
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
}
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 {
id: payoutButton
2024-06-07 18:03:22 +01:00
onClicked: PlayerAreaModel.payout()
enabled: false
2024-06-07 18:03:22 +01:00
anchors {
left: roulette.left
bottom: parent.bottom
bottomMargin: 20
}
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
}
}
color: {
if (enabled == true) {
"#AAAAAA"
} else {
"#444444"
}
}
2024-06-07 18:03:22 +01:00
border.width: 0
}
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
}
Results {
}
}
}