Warning, /rolisteam/rolisteam-diceparser/src/bin/mobile/main.qml is written in an unsupported language. File is not indexed.

0001 import QtQuick 2.7
0002 import QtQuick.Window 2.2
0003 
0004 Window {
0005     id:root
0006     visible: true
0007     signal addRoll(string name, string cmd )
0008     signal roll(string cmd)
0009     color: "black"
0010     height: 1280
0011     width: 720
0012 
0013     Column{
0014 
0015         anchors.fill: parent
0016         leftPadding: width*0.025
0017         rightPadding: width*0.025
0018         topPadding: width*0.025
0019         Rectangle {
0020             height: parent.height*0.12
0021             width: parent.width*0.95
0022             Image {
0023                 anchors.fill: parent
0024                 horizontalAlignment: Image.AlignHCenter
0025                 verticalAlignment:Image.AlignVCenter
0026                 fillMode: Image.PreserveAspectFit
0027                 source: "qrc:/resources/images/add.png"
0028             }
0029             gradient: Gradient {
0030                 GradientStop { position: 0.0; color: "darkblue" }
0031                 GradientStop { position: 1.0; color: "blue" }
0032             }
0033             MouseArea {
0034                 anchors.fill: parent
0035                 onClicked:popupAdd.visible = true
0036             }
0037         }
0038 
0039         ListView {
0040             model: _model
0041             focus: true
0042             height: parent.height*0.88
0043             width: parent.width*0.95
0044             delegate: Item{
0045                 height: parent.height
0046                 width: parent.width
0047                 Column{
0048                     width: parent.width
0049                     height: parent.height
0050                     Text{
0051                         text: name
0052                         font.pointSize: 40
0053                         color: "white"
0054 
0055 
0056                     }
0057                     Text{
0058                         text: cmd
0059                         font.pointSize:30
0060                         color: "white"
0061 
0062                     }
0063                 }
0064                 MouseArea{
0065                     anchors.fill:parent
0066                     onClicked: roll(cmd)
0067                 }
0068             }
0069         }
0070 
0071     }
0072     Rectangle {
0073         id: popupAdd
0074         color: "black"
0075         x: parent.width*0.1
0076         y: parent.height*0.1
0077         height: parent.height*0.80
0078         width: parent.width*0.80
0079         visible: false
0080         border.color: "white"
0081         border.width: 1
0082 
0083         Column{
0084             id:form
0085             anchors.top: parent.top
0086             anchors.left: parent.left
0087             anchors.right: parent.right
0088             height: parent.height*0.80
0089             leftPadding: width*0.025
0090             rightPadding: width*0.025
0091             topPadding: width*0.025
0092             property alias name : nameInp
0093             property alias cmd : cmdInp
0094             Text {
0095                 text: qsTr("Name")
0096                 color: "white"
0097                 height: parent.height*0.1
0098                 font.pointSize: 40
0099             }
0100             Rectangle{
0101                 height: parent.height*0.1
0102                 width: parent.width*0.90
0103                 border.color: "#BBBBBB"
0104                 border.width: 1
0105                 color: "black"
0106                 TextInput{
0107                     id: nameInp
0108                     color: "white"
0109                     anchors.fill: parent
0110                     font.pointSize: 40
0111                 }
0112             }
0113 
0114             Text {
0115                 text: qsTr("Command")
0116                 color: "white"
0117                 height: parent.height*0.1
0118                 font.pointSize: 40
0119             }
0120             Rectangle{
0121                 height: parent.height*0.1
0122                 width: parent.width*0.90
0123                 border.color: "#BBBBBB"
0124                 border.width: 1
0125                 color: "black"
0126                 TextInput{
0127                     id: cmdInp
0128                     color: "white"
0129                     anchors.fill: parent
0130                     font.pointSize: 40
0131                 }
0132             }
0133         }
0134 
0135         Rectangle {
0136             color:"red"
0137             id: cancel
0138             anchors.top: form.bottom
0139             anchors.left: form.left
0140             anchors.right: form.horizontalCenter
0141             anchors.bottom: parent.bottom
0142             radius: height/2
0143             MouseArea {
0144                 anchors.fill: parent
0145                 onClicked:{
0146                     nameInp.text=""
0147                     cmdInp.text=""
0148                     popupAdd.visible = false
0149                 }
0150             }
0151         }
0152         Rectangle {
0153             color:"green"
0154             anchors.top: form.bottom
0155             anchors.left: cancel.right
0156             anchors.right: form.right
0157             anchors.bottom: parent.bottom
0158             radius: height/2
0159             MouseArea {
0160                 anchors.fill: parent
0161                 onClicked:
0162                 {
0163                     root.addRoll(nameInp,cmdInp.text);
0164                     nameInp.text=""
0165                     cmdInp.text=""
0166                     popupAdd.visible = false
0167                 }
0168             }
0169 
0170         }
0171     }
0172 }