Guest User

Untitled

a guest
Apr 20th, 2013
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import QtQuick 1.1
  2. import Sailfish.Silica 1.0
  3. import "../config.js" as DB
  4.  
  5. Page {
  6.     id: page
  7.  
  8.     // To enable PullDownMenu, place our content in a SilicaFlickable
  9.     SilicaFlickable {
  10.         anchors.fill: parent
  11.  
  12.         // PullDownMenu and PushUpMenu must be declared in SilicaFlickable, SilicaListView or SilicaGridView
  13.         PullDownMenu {
  14.             MenuItem {
  15.                 text: "Save"
  16.                 onClicked: {
  17.                     DB.setNote(noteTitle.text,note.text)
  18.                     console.debug("Save note " + noteTitle.text + " with text: " + note.text)
  19.                     FirstPage.getNotes()
  20.                 }
  21.  
  22.             }
  23.         }
  24.         // Tell SilicaFlickable the height of its content.
  25.         contentHeight: childrenRect.height
  26.  
  27.         Column {
  28.             width: page.width
  29.             spacing: theme.paddingLarge
  30.             TextField {
  31.                 id: noteTitle
  32.                 anchors.top: parent.top
  33.                 width: parent.width - 120
  34.                 anchors.topMargin: 20
  35.                 anchors.left: parent.left
  36.                 anchors.leftMargin: 80
  37.                 placeholderText: "Title of Note"
  38.             }
  39.  
  40.             TextArea {
  41.                 id: note
  42.                 placeholderText: "Put note in here"
  43.                 focus: true
  44.                 width: parent.width
  45.                 height: page.height - 120
  46.                 anchors.top: noteTitle.bottom
  47.             }
  48.         }
  49.     }
  50.  
  51. }
Advertisement
Add Comment
Please, Sign In to add comment