From 79187ba80734124ec87e93ad9bcb57cb3514f2e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Max=20Gr=C3=BCtzner?= Date: Fri, 15 Feb 2019 15:32:59 +0100 Subject: [PATCH] added GameComboBox --- qml/StartPage.qml | 13 +++++++++++++ qml/components/GameComboBox.qml | 20 ++++++++++++++++++++ qml/qml.qrc | 1 + 3 files changed, 34 insertions(+) create mode 100644 qml/components/GameComboBox.qml diff --git a/qml/StartPage.qml b/qml/StartPage.qml index b6a28e0..6a8ac7e 100644 --- a/qml/StartPage.qml +++ b/qml/StartPage.qml @@ -11,6 +11,18 @@ Page { } signal pageOpened() + GameComboBox { + height: 40 + width: 140 + } + ComboBox { + anchors { + top: parent.top + topMargin: 40 + } + } + + /* GameButton { id: calenderButton text: "calender" @@ -40,4 +52,5 @@ Page { game.calculator() } } + */ } diff --git a/qml/components/GameComboBox.qml b/qml/components/GameComboBox.qml new file mode 100644 index 0000000..014733c --- /dev/null +++ b/qml/components/GameComboBox.qml @@ -0,0 +1,20 @@ +import QtQuick 2.0 +import QtQuick.Controls 2.2 + +Item { + property string clickedColor: "#BDBDBD" + property string normalColor: "#e0e0e0" + property string color: normalColor + Rectangle { + color: parent.color + width: parent.width + height: parent.height + } + + MouseArea { + width: parent.width + height: parent.height + onPressed: parent.color = parent.clickedColor + onReleased: parent.color = parent.normalColor + } +} diff --git a/qml/qml.qrc b/qml/qml.qrc index a9a893e..7464ec5 100644 --- a/qml/qml.qrc +++ b/qml/qml.qrc @@ -11,5 +11,6 @@ calender/CalenderRunningPage.qml calender/CalenderGameOverPage.qml components/GameButton.qml + components/GameComboBox.qml