import QtQuick 2.5
import fbx.application 1.0
import fbx.ui.page 1.0

Page {
title: "Selection"

ListModel {
id: model
ListElement {
name: "Jeu 1"
jeu: "RandomPlus.qml"
txt: "Jeu aléatoire"
}
ListElement {
name: "Jeu 2"
jeu: "jeuDeplacement.qml"
txt: "Jeu déplacement"
}
}

GridView {
width: 600; height: 200
cellWidth: 300
anchors.centerIn: parent
id: grid
model: model
focus: true
highlight: Rectangle { color: "lightsteelblue"; radius: 5 }

delegate: Column {
Text { text: txt; anchors.horizontalCenter: parent.horizontalCenter; color: "white"; font.pixelSize: 20 }
}

Keys.onReturnPressed: {
stack.push(model.get(grid.currentIndex).jeu)
}
}
}