From 2c6ec93484f9faf1eed23679bd79a38d6fa5a9ff Mon Sep 17 00:00:00 2001 From: Dorian Pula Date: Tue, 13 Feb 2018 23:22:15 -0500 Subject: [PATCH] Get examples of working buttons. --- Menu.qml | 50 +++++++++++++++++++++++++++++++++++++++++++++++--- main.qml | 5 ----- 2 files changed, 47 insertions(+), 8 deletions(-) diff --git a/Menu.qml b/Menu.qml index f6d3db3..2452bbd 100644 --- a/Menu.qml +++ b/Menu.qml @@ -1,4 +1,5 @@ import QtQuick 2.0 +import QtQuick.Controls 1.4 Rectangle { anchors.fill: parent @@ -28,9 +29,53 @@ Rectangle { } } - Rectangle { - id: versionLabel + Column { + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + width: parent.width + spacing: 5 + Rectangle { + id: button + anchors.horizontalCenter: parent.horizontalCenter + + width: parent.width - 50 + height: 50 + radius: 5 + + color: "#777777" + + border.color: "#333333" + border.width: 3 + + Text { + text: "New Game" + font.bold: true + height: 30 + + anchors.centerIn: parent + } + + MouseArea { + anchors.fill: parent + onPressed: button.color = "#555555" + onClicked: { + appPage.source = "Board.qml" + } + } + } + + Button { + text: "Quit" + width: parent.width - 50 + height: 50 + onClicked: Qt.quit() + + anchors.horizontalCenter: parent.horizontalCenter + } + } + + Rectangle { anchors.horizontalCenter: parent.horizontalCenter anchors.bottom: parent.bottom anchors.bottomMargin: 20 @@ -40,7 +85,6 @@ Rectangle { height: 20 Text { - // TODO: Add in a way to dynamically get the version of the app. text: "v" + appVersion anchors.verticalCenter: parent.verticalCenter anchors.right: parent.right diff --git a/main.qml b/main.qml index 2f994d4..00646cb 100644 --- a/main.qml +++ b/main.qml @@ -18,9 +18,4 @@ Window { property var version: appVersion } - - MouseArea { - anchors.fill: parent - onClicked: appPage.source = "Board.qml" - } }