diff options
author | Zeno Albisser <zeno.albisser@nokia.com> | 2010-08-18 08:32:23 -0400 |
---|---|---|
committer | Zeno Albisser <zeno.albisser@nokia.com> | 2010-08-18 08:32:23 -0400 |
commit | 537eca77569351677466ab531c04892dd415d598 (patch) | |
tree | 61abeefdb8341ab23640605bf147cc2db2166509 | |
parent | 4b655889c698c73e2d1af5c25057f86b6370f302 (diff) |
implemented boundary checking for stroke list
-rw-r--r-- | multilayer-dashboard/StrokeList.qml | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/multilayer-dashboard/StrokeList.qml b/multilayer-dashboard/StrokeList.qml index 6b58ee9..4881fa8 100644 --- a/multilayer-dashboard/StrokeList.qml +++ b/multilayer-dashboard/StrokeList.qml @@ -40,6 +40,13 @@ Rectangle { text: modelData } } + + property int maxY : (mainrect.height < list.childrenRect.height) ? + 0 : + (mainrect.height - list.childrenRect.height) + property int minY : (mainrect.height < list.childrenRect.height) ? + -(list.childrenRect.height - mainrect.height) : + 0 } GestureArea { anchors.fill: parent @@ -51,6 +58,11 @@ Rectangle { list.y += gesture.delta.y else if (Math.abs(gesture.offset.y) >= 10 && Math.abs(gesture.offset.x) < 10) parent.panEnabled = true + + if(list.y > list.maxY) + list.y = list.maxY + else if(list.y < list.minY) + list.y = list.minY } onFinished: { parent.panEnabled = false |