Add win overlay
This commit is contained in:
parent
d21e9d1336
commit
48d1bd0a89
|
@ -122,4 +122,6 @@ ApplicationWindow {
|
|||
cardWidth: app.cardWidth
|
||||
cardHeight: app.cardHeight
|
||||
}
|
||||
|
||||
WinOverlay {}
|
||||
}
|
||||
|
|
30
qml/WinOverlay.qml
Normal file
30
qml/WinOverlay.qml
Normal 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
|
||||
}
|
||||
}
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue