Advertisement
Guest User

nemo_

a guest
Jan 10th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QML 1.78 KB | None | 0 0
  1. import QtQuick 2.0
  2. import Sailfish.Silica 1.0
  3. import Nemo.Notifications 1.0
  4.  
  5. Page {
  6.     id: page
  7.  
  8.     // The effective value will be restricted by ApplicationWindow.allowedOrientations
  9.     allowedOrientations: Orientation.All
  10.  
  11.     // To enable PullDownMenu, place our content in a SilicaFlickable
  12.     SilicaFlickable {
  13.         anchors.fill: parent
  14.  
  15.         // PullDownMenu and PushUpMenu must be declared in SilicaFlickable, SilicaListView or SilicaGridView
  16.         PullDownMenu {
  17.             MenuItem {
  18.                 text: qsTr("Show Page 2")
  19.                 onClicked: pageStack.push(Qt.resolvedUrl("SecondPage.qml"))
  20.             }
  21.         }
  22.  
  23.         // Tell SilicaFlickable the height of its content.
  24.         contentHeight: column.height
  25.  
  26.         // Place our content in a Column.  The PageHeader is always placed at the top
  27.         // of the page, followed by our content.
  28.         Column {
  29.             id: column
  30.  
  31.             width: page.width
  32.             spacing: Theme.paddingLarge
  33.             PageHeader {
  34.                 title: qsTr("UI Template")
  35.             }
  36.             Label {
  37.                 x: Theme.horizontalPageMargin
  38.                 text: qsTr("Hello Sailors")
  39.                 color: Theme.secondaryHighlightColor
  40.                 font.pixelSize: Theme.fontSizeExtraLarge
  41.             }
  42.  
  43.  
  44.             Button {
  45.                 Notification {
  46.                     id: notification
  47.  
  48.                     summary: "Notification summary"
  49.                     body: "Notification body"
  50.                     onClicked: console.log("Clicked")
  51.                 }
  52.                 text: "Application notification" + (notification.replacesId ? " ID:" + notification.replacesId : "")
  53.                 onClicked: notification.publish()
  54.             }
  55.  
  56.         }
  57.     }
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement