diff options
author | Javier S. Pedro <maemo@javispedro.com> | 2012-01-30 19:54:44 +0100 |
---|---|---|
committer | Javier S. Pedro <maemo@javispedro.com> | 2012-01-30 19:54:44 +0100 |
commit | 1375a26b135547fdd8e07db62acf8116a8482560 (patch) | |
tree | 96cb70c28d7c3cb05947caa39dde9d360e4903dc /qmsgwatchlet/metawatch-digital.qml | |
parent | c916a1e3cb9440737a9414d6f28505b67209e3cb (diff) | |
download | sowatch-1375a26b135547fdd8e07db62acf8116a8482560.tar.gz sowatch-1375a26b135547fdd8e07db62acf8116a8482560.zip |
add a qt mobility messaging based watchlet
Diffstat (limited to 'qmsgwatchlet/metawatch-digital.qml')
-rw-r--r-- | qmsgwatchlet/metawatch-digital.qml | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/qmsgwatchlet/metawatch-digital.qml b/qmsgwatchlet/metawatch-digital.qml new file mode 100644 index 0000000..43c6e1f --- /dev/null +++ b/qmsgwatchlet/metawatch-digital.qml @@ -0,0 +1,65 @@ +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 + 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 { + property bool selected: ListView.isCurrentItem + width: list.width + height: childrenRect.height + color: ListView.isCurrentItem ? "black" : "white" + Text { + width: 96 + text: "<b>" + sender + "</b><br>" + subject + wrapMode: Text.WrapAtWordBoundaryOrAnywhere + color: parent.selected ? "white" : "black" + } + } + } + + Connections { + target: watch + onButtonPressed : { + switch (button) { + case 1: + list.scrollUp(); + break; + case 2: + list.scrollDown(); + break; + } + } + } +} |