solitare/qml/WinOverlay.qml

36 lines
721 B
QML

import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Solitare
Rectangle {
id: winOverlay
color: "black"
opacity: 0.8
visible: GameState.gameWon === true
anchors.fill: parent
signal restart
Text {
id: winText
text: "YOU WON!"
font.pixelSize: 50
color: "white"
font.bold: true
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
}
Button {
text: "Restart"
onClicked: {
GameState.dealCards();
winOverlay.restart();
}
anchors.top: winText.bottom
anchors.horizontalCenter: parent.horizontalCenter
}
}