diff --git a/src/gui/qml/deployment.pri b/src/gui/qml/deployment.pri new file mode 100644 index 00000000..5441b63d --- /dev/null +++ b/src/gui/qml/deployment.pri @@ -0,0 +1,27 @@ +android-no-sdk { + target.path = /data/user/qt + export(target.path) + INSTALLS += target +} else:android { + x86 { + target.path = /libs/x86 + } else: armeabi-v7a { + target.path = /libs/armeabi-v7a + } else { + target.path = /libs/armeabi + } + export(target.path) + INSTALLS += target +} else:unix { + isEmpty(target.path) { + qnx { + target.path = /tmp/$${TARGET}/bin + } else { + target.path = /opt/$${TARGET}/bin + } + export(target.path) + } + INSTALLS += target +} + +export(INSTALLS) diff --git a/src/gui/qml/images/button-default.xcf b/src/gui/qml/images/button-default.xcf new file mode 100644 index 00000000..1cbb1600 Binary files /dev/null and b/src/gui/qml/images/button-default.xcf differ diff --git a/src/gui/qml/images/button-pressed.xcf b/src/gui/qml/images/button-pressed.xcf new file mode 100644 index 00000000..1f565aab Binary files /dev/null and b/src/gui/qml/images/button-pressed.xcf differ diff --git a/src/gui/qml/main.qml b/src/gui/qml/main.qml new file mode 100644 index 00000000..e5be9b75 --- /dev/null +++ b/src/gui/qml/main.qml @@ -0,0 +1,153 @@ +import QtQuick 2.4 +import QtQuick.Controls 1.3 +import QtQuick.Controls.Styles 1.2 +import QtQuick.Window 2.2 +import QtQuick.Dialogs 1.2 +import "views/startview" + +ApplicationWindow { + id: appWindow + title: qsTr("PokerTH - The open source poker app") + width: 1024 + height: 600 + minimumWidth: 320 + minimumHeight: 240 + visible: true + + toolBar: Rectangle { + id: toolbar + opacity: 1 + Behavior on opacity { NumberAnimation{} } + color: "#FF9800" + width: appWindow.width + height: appWindow.height*0.15 + Behavior on height { NumberAnimation{} } + Rectangle { //Shadow + y: parent.height + width: parent.width + height: parent.height*0.07 + gradient: Gradient { + GradientStop { position: 0.0; color: Qt.rgba(0,0,0,0.5) } + GradientStop { position: 1.0; color: Qt.rgba(0,0,0,0.0) } + } + } + + Rectangle { + id: toolBarLeftButton + anchors.verticalCenter: parent.verticalCenter + antialiasing: true + height: parent.height + width: parent.height + radius: 4 + color: leftMouse.pressed ? Qt.rgba(0,0,0,0.3) : "transparent" + property string myIconName: "" + property string myIconPath: "" + function setIconPath(name) { + switch(name) { + case "PokerTH": myIconPath = "images/pokerth-logo.svg" + break; + case "back": myIconPath = "images/arrow_back.svg" + break; + default: myIconPath = "" + } + } + onMyIconNameChanged: setIconPath(myIconName) + + + Image { + sourceSize.height: parent.height*0.8 + fillMode: Image.PreserveAspectFit + anchors.centerIn: parent + source: parent.myIconPath + } + MouseArea { + id: leftMouse + anchors.fill: parent + anchors.margins: -10 + onClicked: stackView.pop() + } + } + + Text { + id: toolBarText + font.pixelSize: Math.min(parent.height*0.5, parent.width*0.08) + x: toolBarLeftButton.x + toolBarLeftButton.width*1.5 + anchors.verticalCenter: parent.verticalCenter + color: "white" + text: "PokerTH" + + } + + Rectangle { + id: toolBarRightButton + anchors.verticalCenter: parent.verticalCenter + anchors.right: parent.right + antialiasing: true + height: parent.height + width: parent.height + radius: 4 + color: rightMouse.pressed ? Qt.rgba(0,0,0,0.3) : "transparent" + + property string myIconName: "" + property string myIconPath: "" + function setIconPath(name) { + switch(name) { + case "accept": myIconPath = "images/check.svg" + break; + case "more": myIconPath = "images/more_vert.svg" + break; + default: myIconPath = "" + } + } + onMyIconNameChanged: setIconPath(myIconName) + + Image { + sourceSize.height: parent.height*0.8 + fillMode: Image.PreserveAspectFit + anchors.centerIn: parent + source: parent.myIconPath + } + MouseArea { + id: rightMouse + anchors.fill: parent + anchors.margins: -10 + onClicked: stackView.pop() + } + } + } + + StackView { + id: stackView + anchors.fill: parent + // Implements back key navigation + focus: true + Keys.onReleased: if (event.key === Qt.Key_Back && stackView.depth > 1) { + stackView.pop(); + event.accepted = true; + } + + initialItem: StartView { } + + // delegate: StackViewDelegate { + // function transitionFinished(properties) + // { + // properties.exitItem.opacity = 1 + // } + + // pushTransition: StackViewTransition { + // PropertyAnimation { + // target: enterItem + // property: "opacity" + // from: 0 + // to: 1 + // } + // PropertyAnimation { + // target: exitItem + // property: "opacity" + // from: 1 + // to: 0 + // } + // } + // } + } +} diff --git a/src/gui/qml/qml.qrc b/src/gui/qml/qml.qrc new file mode 100644 index 00000000..2d55fd9f --- /dev/null +++ b/src/gui/qml/qml.qrc @@ -0,0 +1,17 @@ + + + main.qml + components/ListViewDelegateFactory.qml + images/arrow_back.svg + images/button-default.png + images/button-pressed.png + images/check.svg + images/more_vert.svg + images/pokerth-logo.svg + images/startViewBackground.png + views/startview/StartButton.qml + views/startview/StartView.qml + views/createlocalgameview/CreateLocalGameView.qml + components/MyComboBoxSelector.qml + +