diff --git a/qml/Main.qml b/qml/Main.qml index a07c34b..0442717 100644 --- a/qml/Main.qml +++ b/qml/Main.qml @@ -122,4 +122,6 @@ ApplicationWindow { cardWidth: app.cardWidth cardHeight: app.cardHeight } + + WinOverlay {} } diff --git a/qml/WinOverlay.qml b/qml/WinOverlay.qml new file mode 100644 index 0000000..30c964f --- /dev/null +++ b/qml/WinOverlay.qml @@ -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 + } +} diff --git a/qml/qml.qrc b/qml/qml.qrc index cbd1576..83f98fc 100644 --- a/qml/qml.qrc +++ b/qml/qml.qrc @@ -8,6 +8,7 @@ ../qml/ScoreBar.qml ../qml/Tableau.qml ../qml/ThrowawayPile.qml + ../qml/WinOverlay.qml