aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/bin/mobile/main.qml
diff options
context:
space:
mode:
authorRenaud G <renaud@rolisteam.org>2022-04-29 10:48:09 +0200
committerRenaud G <renaud@rolisteam.org>2022-04-29 10:48:09 +0200
commit07c5f6ec23fcf9237a24e71adcfacabce677f818 (patch)
tree588e8c5f82b9163181fad3581f610e6f1d88cba4 /src/bin/mobile/main.qml
parenta9153f1615a842cfb9e9bcda4d9071e202618569 (diff)
downloadOneRoll-07c5f6ec23fcf9237a24e71adcfacabce677f818.tar.gz
OneRoll-07c5f6ec23fcf9237a24e71adcfacabce677f818.zip
Change file organization.
Diffstat (limited to 'src/bin/mobile/main.qml')
-rw-r--r--src/bin/mobile/main.qml172
1 files changed, 172 insertions, 0 deletions
diff --git a/src/bin/mobile/main.qml b/src/bin/mobile/main.qml
new file mode 100644
index 0000000..700f3a7
--- /dev/null
+++ b/src/bin/mobile/main.qml
@@ -0,0 +1,172 @@
+import QtQuick 2.7
+import QtQuick.Window 2.2
+
+Window {
+ id:root
+ visible: true
+ signal addRoll(string name, string cmd )
+ signal roll(string cmd)
+ color: "black"
+ height: 1280
+ width: 720
+
+ Column{
+
+ anchors.fill: parent
+ leftPadding: width*0.025
+ rightPadding: width*0.025
+ topPadding: width*0.025
+ Rectangle {
+ height: parent.height*0.12
+ width: parent.width*0.95
+ Image {
+ anchors.fill: parent
+ horizontalAlignment: Image.AlignHCenter
+ verticalAlignment:Image.AlignVCenter
+ fillMode: Image.PreserveAspectFit
+ source: "qrc:/resources/images/add.png"
+ }
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "darkblue" }
+ GradientStop { position: 1.0; color: "blue" }
+ }
+ MouseArea {
+ anchors.fill: parent
+ onClicked:popupAdd.visible = true
+ }
+ }
+
+ ListView {
+ model: _model
+ focus: true
+ height: parent.height*0.88
+ width: parent.width*0.95
+ delegate: Item{
+ height: parent.height
+ width: parent.width
+ Column{
+ width: parent.width
+ height: parent.height
+ Text{
+ text: name
+ font.pointSize: 40
+ color: "white"
+
+
+ }
+ Text{
+ text: cmd
+ font.pointSize:30
+ color: "white"
+
+ }
+ }
+ MouseArea{
+ anchors.fill:parent
+ onClicked: roll(cmd)
+ }
+ }
+ }
+
+ }
+ Rectangle {
+ id: popupAdd
+ color: "black"
+ x: parent.width*0.1
+ y: parent.height*0.1
+ height: parent.height*0.80
+ width: parent.width*0.80
+ visible: false
+ border.color: "white"
+ border.width: 1
+
+ Column{
+ id:form
+ anchors.top: parent.top
+ anchors.left: parent.left
+ anchors.right: parent.right
+ height: parent.height*0.80
+ leftPadding: width*0.025
+ rightPadding: width*0.025
+ topPadding: width*0.025
+ property alias name : nameInp
+ property alias cmd : cmdInp
+ Text {
+ text: qsTr("Name")
+ color: "white"
+ height: parent.height*0.1
+ font.pointSize: 40
+ }
+ Rectangle{
+ height: parent.height*0.1
+ width: parent.width*0.90
+ border.color: "#BBBBBB"
+ border.width: 1
+ color: "black"
+ TextInput{
+ id: nameInp
+ color: "white"
+ anchors.fill: parent
+ font.pointSize: 40
+ }
+ }
+
+ Text {
+ text: qsTr("Command")
+ color: "white"
+ height: parent.height*0.1
+ font.pointSize: 40
+ }
+ Rectangle{
+ height: parent.height*0.1
+ width: parent.width*0.90
+ border.color: "#BBBBBB"
+ border.width: 1
+ color: "black"
+ TextInput{
+ id: cmdInp
+ color: "white"
+ anchors.fill: parent
+ font.pointSize: 40
+ }
+ }
+ }
+
+ Rectangle {
+ color:"red"
+ id: cancel
+ anchors.top: form.bottom
+ anchors.left: form.left
+ anchors.right: form.horizontalCenter
+ anchors.bottom: parent.bottom
+ radius: height/2
+ MouseArea {
+ anchors.fill: parent
+ onClicked:{
+ nameInp.text=""
+ cmdInp.text=""
+ popupAdd.visible = false
+ }
+ }
+ }
+ Rectangle {
+ color:"green"
+ anchors.top: form.bottom
+ anchors.left: cancel.right
+ anchors.right: form.right
+ anchors.bottom: parent.bottom
+ radius: height/2
+ MouseArea {
+ anchors.fill: parent
+ onClicked:
+ {
+ root.addRoll(nameInp,cmdInp.text);
+ nameInp.text=""
+ cmdInp.text=""
+ popupAdd.visible = false
+ }
+ }
+
+ }
+ }
+}