From 7b36312ed37f46f08248db92af7aeae879de7d93 Mon Sep 17 00:00:00 2001 From: Dorian Pula Date: Tue, 13 Feb 2018 08:53:53 -0500 Subject: [PATCH] Build out very basic layout of menu based on Kivy. --- Board.qml | 6 ++++++ Menu.qml | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ main.qml | 15 +++++++++++++-- qml.qrc | 13 +++++++++++++ 4 files changed, 82 insertions(+), 2 deletions(-) create mode 100644 Board.qml create mode 100644 Menu.qml diff --git a/Board.qml b/Board.qml new file mode 100644 index 0000000..638eb46 --- /dev/null +++ b/Board.qml @@ -0,0 +1,6 @@ +import QtQuick 2.0 + +Rectangle { + anchors.fill: parent + color: "orange" +} diff --git a/Menu.qml b/Menu.qml new file mode 100644 index 0000000..f69821f --- /dev/null +++ b/Menu.qml @@ -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 + } + } +} diff --git a/main.qml b/main.qml index 311efb9..41352d1 100644 --- a/main.qml +++ b/main.qml @@ -3,7 +3,18 @@ import QtQuick.Window 2.2 Window { visible: true - width: 640 - height: 480 + width: 800 + height: 600 title: qsTr("justCheckers") + + Loader { + id: appPage + source: "Menu.qml" + anchors.fill: parent + } + + MouseArea { + anchors.fill: parent + onClicked: appPage.source = "Board.qml" + } } diff --git a/qml.qrc b/qml.qrc index 5f6483a..d4ebdd7 100644 --- a/qml.qrc +++ b/qml.qrc @@ -1,5 +1,18 @@ main.qml + Board.qml + Menu.qml + images/attack_king.png + images/attack_pawn.png + images/backdrop.jpg + images/defend_king.png + images/defend_pawn.png + images/icon.png + images/idea.png + images/logo.png + images/non_play.png + images/play.png + images/splash.jpg