summaryrefslogtreecommitdiff
path: root/qorgwatchlet/metawatch-digital.qml
diff options
context:
space:
mode:
authorJavier S. Pedro <maemo@javispedro.com>2013-05-03 21:15:59 +0200
committerJavier S. Pedro <maemo@javispedro.com>2013-05-03 21:15:59 +0200
commit7897ec1596a4348cd926eff7c1d4f03616ed535c (patch)
treec21374cfcf613198dd52e39e89be982a10263fc8 /qorgwatchlet/metawatch-digital.qml
parent9e061170b3834845910749c55eda63f03d982bbf (diff)
downloadsowatch-7897ec1596a4348cd926eff7c1d4f03616ed535c.tar.gz
sowatch-7897ec1596a4348cd926eff7c1d4f03616ed535c.zip
preparing new qorgwatchlet
Diffstat (limited to 'qorgwatchlet/metawatch-digital.qml')
-rw-r--r--qorgwatchlet/metawatch-digital.qml82
1 files changed, 82 insertions, 0 deletions
diff --git a/qorgwatchlet/metawatch-digital.qml b/qorgwatchlet/metawatch-digital.qml
new file mode 100644
index 0000000..e5e999f
--- /dev/null
+++ b/qorgwatchlet/metawatch-digital.qml
@@ -0,0 +1,82 @@
+import QtQuick 1.0
+import QtMobility.messaging 1.1
+import com.javispedro.sowatch.metawatch 1.0
+
+MWPage {
+ MWTitle {
+ id: title
+ anchors.top: parent.top
+ anchors.left: parent.left
+ anchors.right: parent.right
+ text: qsTr("Inbox")
+ icon.source: "icon.png"
+ }
+
+ MWListView {
+ id: list
+ anchors.top: title.bottom
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.bottom: parent.bottom
+ clip: true
+ model: MessageModel {
+ sortBy: MessageModel.Timestamp
+ sortOrder: MessageModel.DescendingOrder
+ filter: MessageIntersectionFilter {
+ MessageFilter {
+ type: MessageFilter.Type
+ comparator: MessageFilter.Equal
+ value: MessageFilter.Email
+ }
+ MessageFilter {
+ type: MessageFilter.StandardFolder
+ comparator: MessageFilter.Equal
+ value: MessageFilter.InboxFolder
+ }
+ }
+ limit: 20
+ }
+ delegate: Rectangle {
+ id: msgDelegate
+ property bool selected: ListView.isCurrentItem
+ width: parent.width
+ height: childrenRect.height
+ color: ListView.isCurrentItem ? "black" : "white"
+ Column {
+ width: parent.width
+ MWLabel {
+ width: parent.width
+ text: sender
+ wrapMode: Text.WrapAtWordBoundaryOrAnywhere
+ color: msgDelegate.selected ? "white" : "black"
+ font.pointSize: 12
+ }
+ MWLabel {
+ width: parent.width
+ text: subject
+ wrapMode: Text.WrapAtWordBoundaryOrAnywhere
+ color: msgDelegate.selected ? "white" : "black"
+ }
+ }
+ }
+ }
+
+ Connections {
+ target: watch
+ onButtonPressed: {
+ switch (button) {
+ case 1:
+ list.scrollUp();
+ break;
+ case 2:
+ list.scrollDown();
+ break;
+ }
+ }
+ onActiveChanged: {
+ if (watch.active) {
+ list.scrollTop();
+ }
+ }
+ }
+}