Move FoundationPiles to it's own file
This commit is contained in:
parent
44318ac5ac
commit
bbf1cd2eaa
|
@ -25,6 +25,7 @@ qt_add_qml_module(appSolitare
|
||||||
QML_FILES Tableau.qml
|
QML_FILES Tableau.qml
|
||||||
QML_FILES ThrowawayPile.qml
|
QML_FILES ThrowawayPile.qml
|
||||||
QML_FILES DrawPile.qml
|
QML_FILES DrawPile.qml
|
||||||
|
QML_FILES FoundationPiles.qml
|
||||||
SOURCES playingcard.h playingcard.cpp
|
SOURCES playingcard.h playingcard.cpp
|
||||||
SOURCES gamestate.h gamestate.cpp
|
SOURCES gamestate.h gamestate.cpp
|
||||||
SOURCES columnslot.h columnslot.cpp
|
SOURCES columnslot.h columnslot.cpp
|
||||||
|
|
14
FoundationPiles.qml
Normal file
14
FoundationPiles.qml
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
import QtQuick
|
||||||
|
|
||||||
|
Row {
|
||||||
|
spacing: 15
|
||||||
|
|
||||||
|
Repeater {
|
||||||
|
model: 4 // Each of the 4 suits
|
||||||
|
CardModel {
|
||||||
|
required property int index; // passed from repeater
|
||||||
|
card: GameState.foundation[index].length > 0 ? GameState.foundation[index][0] : null
|
||||||
|
isFaceDown: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
16
Main.qml
16
Main.qml
|
@ -29,19 +29,9 @@ ApplicationWindow {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: 10
|
anchors.margins: 10
|
||||||
|
|
||||||
// Left row (with the foundation piles)
|
// Left side
|
||||||
Row {
|
FoundationPiles {
|
||||||
spacing: 15
|
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
|
|
||||||
Repeater {
|
|
||||||
model: 4 // Each of the 4 suits
|
|
||||||
CardModel {
|
|
||||||
required property int index; // passed from repeater
|
|
||||||
card: GameState.foundation[index].length > 0 ? GameState.foundation[index][0] : null
|
|
||||||
isFaceDown: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Spacer to push the second row to the right
|
// Spacer to push the second row to the right
|
||||||
|
@ -49,7 +39,7 @@ ApplicationWindow {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
}
|
}
|
||||||
|
|
||||||
// Right row (with throwaway and draw piles)
|
// Right side
|
||||||
Row {
|
Row {
|
||||||
spacing: 20
|
spacing: 20
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
|
Loading…
Reference in a new issue