summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--notificationswatchlet/metawatch-digital.qml39
1 files changed, 32 insertions, 7 deletions
diff --git a/notificationswatchlet/metawatch-digital.qml b/notificationswatchlet/metawatch-digital.qml
index 4a69a0d..be662ab 100644
--- a/notificationswatchlet/metawatch-digital.qml
+++ b/notificationswatchlet/metawatch-digital.qml
@@ -1,5 +1,4 @@
import QtQuick 1.0
-import QtMobility.location 1.2
Rectangle {
width: 96
@@ -12,26 +11,52 @@ Rectangle {
anchors.fill: parent
model: watch.notifications
delegate: Column {
- Text { text: model.modelData.title }
- Text { text: model.modelData.body }
+ width: parent.width
+ Text {
+ width: parent.width
+ text: model.modelData.title
+ wrapMode: Text.Wrap
+ }
+ Text {
+ width: parent.width
+ text: model.modelData.body
+ wrapMode: Text.Wrap
+ }
+ Rectangle {
+ width: parent.width
+ height: 1
+ color: "black"
+ }
}
visible: count > 0;
}
+
Text {
anchors.fill: parent
- text: "No notifications"
+ text: qsTr("No notifications");
visible: notifs.count == 0;
+ wrapMode: Text.Wrap
}
Connections {
target: watch
onButtonPressed : {
- switch(button) {
+ var increment = (3 * (notifs.width / 4));
+ var maxy = notifs.contentHeight - notifs.height;
+ var newy;
+
+ if (maxy < 0) maxy = 0;
+
+ switch (button) {
case 1:
- notifs.decrementCurrentIndex();
+ newy = notifs.contentY - increment;
+ if (newy < 0) newy = 0;
+ notifs.contentY = newy;
break;
case 2:
- notifs.incrementCurrentIndex();
+ newy = notifs.contentY + increment;
+ if (newy > maxy) newy = maxy;
+ notifs.contentY = newy;
break;
}
}