diff options
Diffstat (limited to 'framework/qml/ConversationListView.qml')
-rw-r--r-- | framework/qml/ConversationListView.qml | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/framework/qml/ConversationListView.qml b/framework/qml/ConversationListView.qml index 2f5c5c32..a7dc1f7d 100644 --- a/framework/qml/ConversationListView.qml +++ b/framework/qml/ConversationListView.qml | |||
@@ -68,6 +68,14 @@ FocusScope { | |||
68 | flickable.decrementCurrentIndex() | 68 | flickable.decrementCurrentIndex() |
69 | } | 69 | } |
70 | 70 | ||
71 | function scrollDown() { | ||
72 | scrollHelper.scrollDown() | ||
73 | } | ||
74 | |||
75 | function scrollUp() { | ||
76 | scrollHelper.scrollUp() | ||
77 | } | ||
78 | |||
71 | Flickable { | 79 | Flickable { |
72 | id: flickable | 80 | id: flickable |
73 | anchors.fill: parent | 81 | anchors.fill: parent |
@@ -81,14 +89,17 @@ FocusScope { | |||
81 | function scrollToIndex(index) { | 89 | function scrollToIndex(index) { |
82 | var item = repeater.itemAt(index) | 90 | var item = repeater.itemAt(index) |
83 | if (item) { | 91 | if (item) { |
84 | var pos = item.y | 92 | scrollToPos(item.y) |
85 | var scrollToEndPos = (flickable.contentHeight - flickable.height) | 93 | } |
86 | //Avoid scrolling past the end | 94 | } |
87 | if (pos < scrollToEndPos) { | 95 | |
88 | flickable.contentY = pos | 96 | function scrollToPos(pos) { |
89 | } else { | 97 | var scrollToEndPos = (flickable.contentHeight - flickable.height) |
90 | flickable.contentY = scrollToEndPos | 98 | //Avoid scrolling past the end |
91 | } | 99 | if (pos < scrollToEndPos) { |
100 | flickable.contentY = pos | ||
101 | } else { | ||
102 | flickable.contentY = scrollToEndPos | ||
92 | } | 103 | } |
93 | } | 104 | } |
94 | 105 | ||