Build out very basic layout of menu based on Kivy.

This commit is contained in:
Dorian 2018-02-13 08:53:53 -05:00
parent 3f408edde6
commit 7b36312ed3
4 changed files with 82 additions and 2 deletions

6
Board.qml Normal file
View File

@ -0,0 +1,6 @@
import QtQuick 2.0
Rectangle {
anchors.fill: parent
color: "orange"
}

50
Menu.qml Normal file
View File

@ -0,0 +1,50 @@
import QtQuick 2.0
Rectangle {
anchors.fill: parent
color: "blue"
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
}
}
Rectangle {
id: version
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 {
// TODO: Add in a way to dynamically get the version of the app.
text: "Version 0.4.0"
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.rightMargin: 20
}
}
}

View File

@ -3,7 +3,18 @@ import QtQuick.Window 2.2
Window { Window {
visible: true visible: true
width: 640 width: 800
height: 480 height: 600
title: qsTr("justCheckers") title: qsTr("justCheckers")
Loader {
id: appPage
source: "Menu.qml"
anchors.fill: parent
}
MouseArea {
anchors.fill: parent
onClicked: appPage.source = "Board.qml"
}
} }

13
qml.qrc
View File

@ -1,5 +1,18 @@
<RCC> <RCC>
<qresource prefix="/"> <qresource prefix="/">
<file>main.qml</file> <file>main.qml</file>
<file>Board.qml</file>
<file>Menu.qml</file>
<file>images/attack_king.png</file>
<file>images/attack_pawn.png</file>
<file>images/backdrop.jpg</file>
<file>images/defend_king.png</file>
<file>images/defend_pawn.png</file>
<file>images/icon.png</file>
<file>images/idea.png</file>
<file>images/logo.png</file>
<file>images/non_play.png</file>
<file>images/play.png</file>
<file>images/splash.jpg</file>
</qresource> </qresource>
</RCC> </RCC>