Advertisement
Guest User

CreateNewListPage.qml

a guest
Mar 20th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QML 5.50 KB | None | 0 0
  1. import QtQuick 2.0
  2. import QtQuick.Controls 2.5
  3. import QtGraphicalEffects 1.12
  4.  
  5. Item {
  6.     Rectangle{
  7.         width: 580
  8.         height: 360
  9.  
  10.  
  11.         Rectangle{
  12.             width: 330
  13.             height: 40
  14.  
  15.             Image {
  16.                 source: "qrc:/../../Desktop/header1.png"
  17.                 y: 10
  18.                 x: 10
  19.                 z: 2
  20.             }
  21.  
  22.             Rectangle{
  23.                 color: "#e9e9e8"
  24.                 width: 130
  25.                 height: 37
  26.                 x: 50
  27.                 y: 12
  28.                 z: 1
  29.                 radius: 20
  30.  
  31.                 Button {
  32.                     x: 22
  33.                     id: buttonBack
  34.  
  35.  
  36.                     background: Rectangle {
  37.                         id: rectangle
  38.                         height: 30
  39.                         color: "transparent"
  40.                         anchors.verticalCenter: parent.verticalCenter
  41.                     }
  42.                     contentItem: Text {
  43.                         id: textContent
  44.                         text: qsTr("My Lists")
  45.                         color: "blue"
  46.                         font.underline: true
  47.                         font.pointSize: 15
  48.                     }
  49.  
  50.                     states:[
  51.                         State {
  52.                             name: "Hovering"
  53.                             PropertyChanges {
  54.                                 target: textContent
  55.                                 color: "white"
  56.                                 font.underline: false
  57.                             }
  58.                             PropertyChanges {
  59.                                 target: rectangle
  60.                                 color: "blue"
  61.                             }
  62.                         }]
  63.  
  64.                     MouseArea{
  65.                         hoverEnabled: true
  66.                         anchors.fill: buttonBack
  67.                         onEntered: { buttonBack.state='Hovering'}
  68.                         onExited: { buttonBack.state=''}
  69.                         onClicked:{
  70.                             myStackView.pop()
  71.                         }
  72.                     }
  73.                 }
  74.  
  75.             }
  76.         }
  77.  
  78.  
  79.         Rectangle{
  80.             width: 250
  81.             height: 50
  82.             x: 30
  83.             y: 60
  84.             Text {
  85.                 text: qsTr("Name your new list")
  86.                 font.bold: true
  87.                 font.pointSize: 10
  88.                 anchors.verticalCenter: parent.verticalCenter
  89.             }
  90.  
  91.             Text {
  92.                 text: qsTr("(Ex: \"Things I need to do today\")");
  93.                 font.pointSize: 7
  94.                 x: 135
  95.                 color: "grey"
  96.                 anchors.verticalCenter: parent.verticalCenter
  97.             }
  98.         }
  99.  
  100.         Rectangle{
  101.             width: 350
  102.             height: 30
  103.             y: 100
  104.             x: 30
  105.             border.color: "#7b9cd3"
  106.             border.width: 1
  107.  
  108.             TextInput {
  109.                 id: textInput
  110.                 anchors.topMargin: 3
  111.                 cursorVisible: true
  112.                 anchors.fill: parent
  113.                 font.bold: true
  114.                 font.pointSize: 14
  115.             }
  116.  
  117.         }
  118.  
  119.  
  120.         Rectangle{
  121.             width: 280
  122.             height: 30
  123.             y: 145
  124.             x: 30
  125.  
  126.             Button{
  127.                 height: 20
  128.                 text: "Create this list"
  129.                 onClicked: {
  130.                     controller.addList(textInput.text)
  131.                     myStackView.push(firstPage)
  132.                 }
  133.  
  134.                 background: Rectangle{
  135.                     id: rect1
  136.                     anchors.fill: parent
  137.                     radius: 20
  138.                     border.color: "#88b6cf"
  139.                     gradient: Gradient {
  140.                             GradientStop { position: 0.0; color: "#fcfefe" }
  141.                             GradientStop { position: 1.0; color: "#d5e8f3" }
  142.                         }
  143.                 }
  144.  
  145.             }
  146.  
  147.             Text {
  148.                 x: 105
  149.                 y: 5
  150.                 text: qsTr(" or ")
  151.  
  152.             }
  153.  
  154.             Button{
  155.                 id: buttonCancel
  156.                 width: 35
  157.                 height: 15
  158.                 x: 140
  159.                 y: 5
  160.  
  161.                 Text {
  162.                     id: textCancel
  163.                     text: qsTr("Cancel")
  164.                     color: "red"
  165.                     font.underline: true
  166.                 }
  167.                 background: Rectangle{
  168.                     id: rectangleCancel
  169.                     anchors.fill: parent
  170.                     color: "transparent"
  171.                 }
  172.  
  173.                 states:[
  174.                     State {
  175.                         name: "Hovering"
  176.                         PropertyChanges {
  177.                             target: textCancel
  178.                             color: "white"
  179.                             font.underline: false
  180.                         }
  181.                         PropertyChanges {
  182.                             target: rectangleCancel
  183.                             color: "red"
  184.                         }
  185.                     }]
  186.  
  187.                 MouseArea{
  188.                     hoverEnabled: true
  189.                     anchors.fill: buttonCancel
  190.                     onEntered: { buttonCancel.state='Hovering'}
  191.                     onExited: { buttonCancel.state=''}
  192.                     onClicked:{
  193.                         myStackView.pop()
  194.                     }
  195.                 }
  196.             }
  197.  
  198.         }
  199.  
  200.  
  201.     }
  202. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement