From a301d1db33fdecb0e66495b51019922a9b040c1f Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Fri, 6 Apr 2018 16:45:04 +0200 Subject: Conversation view keyboard navigation --- framework/qml/ConversationListView.qml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'framework/qml/ConversationListView.qml') diff --git a/framework/qml/ConversationListView.qml b/framework/qml/ConversationListView.qml index a7dc1f7d..1d408edc 100644 --- a/framework/qml/ConversationListView.qml +++ b/framework/qml/ConversationListView.qml @@ -68,14 +68,6 @@ FocusScope { flickable.decrementCurrentIndex() } - function scrollDown() { - scrollHelper.scrollDown() - } - - function scrollUp() { - scrollHelper.scrollUp() - } - Flickable { id: flickable anchors.fill: parent @@ -145,6 +137,14 @@ FocusScope { scrollToIndex(currentIndex) } + Keys.onPressed: { + if (event.matches(StandardKey.MoveToNextLine)) { + scrollHelper.scrollDown() + } else if (event.matches(StandardKey.MoveToPreviousLine)) { + scrollHelper.scrollUp() + } + } + Kube.ScrollHelper { id: scrollHelper flickable: flickable -- cgit v1.2.3