From 4b75f2e03fa833f3073ce8a04d936d840b4af2ca Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 26 Apr 2017 11:00:38 +0200 Subject: Made the maillistview a focus scope and automatically select an index an aquiring focus --- framework/qml/MailListView.qml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'framework') diff --git a/framework/qml/MailListView.qml b/framework/qml/MailListView.qml index a0921a6e..eff3f921 100644 --- a/framework/qml/MailListView.qml +++ b/framework/qml/MailListView.qml @@ -23,7 +23,7 @@ import QtQuick.Layouts 1.1 import org.kube.framework 1.0 as Kube -Item { +FocusScope { id: root //Private properties property variant parentFolder: null @@ -68,12 +68,19 @@ Item { anchors.fill: parent clip: true + focus: true ScrollBar.vertical: ScrollBar{ id: scrollbar } //BEGIN keyboard nav + onActiveFocusChanged: { + if (activeFocus && currentIndex < 0) { + currentIndex = 0 + } + } + Keys.onDownPressed: { incrementCurrentIndex() } -- cgit v1.2.3