Add win overlay

This commit is contained in:
ItsDrike 2024-12-09 21:02:43 +01:00
parent d21e9d1336
commit 48d1bd0a89
Signed by: ItsDrike
GPG key ID: FA2745890B7048C0
3 changed files with 33 additions and 0 deletions

View file

@ -122,4 +122,6 @@ ApplicationWindow {
cardWidth: app.cardWidth
cardHeight: app.cardHeight
}
WinOverlay {}
}

30
qml/WinOverlay.qml Normal file
View file

@ -0,0 +1,30 @@
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
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()
anchors.top: winText.bottom
anchors.horizontalCenter: parent.horizontalCenter
}
}

View file

@ -8,6 +8,7 @@
<file>../qml/ScoreBar.qml</file>
<file>../qml/Tableau.qml</file>
<file>../qml/ThrowawayPile.qml</file>
<file>../qml/WinOverlay.qml</file>
</qresource>
</RCC>
<!-- vi: ft=xml