solitare/qml/FoundationPiles.qml

51 lines
1.2 KiB
QML

import QtQuick
import Solitare
Row {
spacing: 15
Repeater {
model: 4 // Each of the 4 suits
Item {
id: foundationPile
width: foundationCard.width
height: foundationCard.height
required property int index // passed from repeater
CardModel {
id: foundationCard
anchors.fill: parent
visible: GameState.foundation[parent.index].length > 0
card: GameState.foundation[parent.index].length > 0 ? GameState.foundation[parent.index][0] : null
isFaceDown: false
}
Rectangle {
id: emptyPileRect
anchors.fill: parent
visible: GameState.foundation[parent.index].length === 0
color: "gray"
border.color: "white"
border.width: 3
opacity: 0.4
radius: 10
Text {
text: "A"
color: "white"
font.pixelSize: 40
font.bold: true
anchors.centerIn: parent
}
}
}
}
}