justcheckers/Menu.qml

109 lines
2.5 KiB
QML
Raw Normal View History

import QtQuick 2.0
2018-02-22 08:03:26 -05:00
import QtMultimedia 5.8
2018-08-15 17:06:32 -04:00
import QtQuick.Controls 2.2
import QtQuick.Controls.Material 2.2
Rectangle {
anchors.fill: parent
Image {
source: 'images/backdrop.jpg'
anchors.fill: parent
}
Rectangle {
id: logo
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
anchors.topMargin: 20
color: Qt.rgba(1, 1, 1, 0.5)
width: parent.width
height: logoImage.height
Image {
id: logoImage
source: 'images/logo.png'
anchors.horizontalCenter: parent.horizontalCenter
}
}
2018-02-13 23:22:15 -05:00
Column {
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
width: parent.width
2018-02-14 08:53:52 -05:00
spacing: 10
2018-02-13 23:22:15 -05:00
MenuButton {
buttonText: "New Game"
function actionOnClick() {
appPage.source = "Board.qml"
2018-02-14 08:53:52 -05:00
}
}
2018-02-13 23:22:15 -05:00
MenuButton {
buttonText: "Open Game"
2018-08-15 17:06:32 -04:00
enabled: false
}
MenuButton {
buttonText: "Save Game"
2018-08-15 17:06:32 -04:00
enabled: false
2018-02-22 08:03:26 -05:00
function actionOnClick() {
pingSound.seek(0)
pingSound.play()
}
// From: https://freesound.org/people/edsward/sounds/341871/
Audio {
id: pingSound
source: 'assets/ping.wav'
autoLoad: true
}
}
2018-02-13 23:22:15 -05:00
MenuButton {
buttonText: "About justCheckers"
2018-02-13 23:22:15 -05:00
}
MenuButton {
buttonText: "Settings"
}
2018-02-13 23:22:15 -05:00
2018-08-15 17:06:32 -04:00
Button {
anchors.horizontalCenter: parent.horizontalCenter
width: parent.width - 50
height: parent.parent.height * 0.1
text: "Quit"
onPressed: Qt.quit()
Material.accent: Material.Orange
}
MenuButton {
buttonText: "Quit"
function actionOnClick() {
Qt.quit()
}
2018-02-13 23:22:15 -05:00
}
}
Rectangle {
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
anchors.bottomMargin: 20
color: Qt.rgba(1, 1, 1, 0.5)
width: parent.width
height: 20
Text {
2018-02-13 15:18:59 -05:00
text: "v" + appVersion
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.rightMargin: 20
}
}
}