From e5f03361dfe42533dcca34d28d93ab0ad9efa443 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 11 Feb 2016 09:46:59 +0100 Subject: Keyboard navigation It should work natively I think, but for some reason it doesn't. --- .../kube-mail/package/contents/ui/MailListView.qml | 19 ++++++++++++++++--- applications/kube-mail/package/contents/ui/main.qml | 1 + 2 files changed, 17 insertions(+), 3 deletions(-) (limited to 'applications/kube-mail/package') diff --git a/applications/kube-mail/package/contents/ui/MailListView.qml b/applications/kube-mail/package/contents/ui/MailListView.qml index 5e830b73..ff773e0e 100644 --- a/applications/kube-mail/package/contents/ui/MailListView.qml +++ b/applications/kube-mail/package/contents/ui/MailListView.qml @@ -16,7 +16,7 @@ */ import QtQuick 2.4 -import QtQuick.Controls 1.3 +import QtQuick.Controls 1.4 import QtQuick.Layouts 1.1 import QtQml 2.2 @@ -37,20 +37,33 @@ ScrollView { parentFolder: root.parentFolder } - delegate: PlasmaComponents.ListItem { + Keys.onDownPressed: { + incrementCurrentIndex() + } + Keys.onUpPressed: { + decrementCurrentIndex() + } + focus: true + delegate: PlasmaComponents.ListItem { width: listView.width height: unit.size * 12 enabled: true checked: listView.currentIndex == index + Binding { + target: root + property: "currentMail" + when: listView.currentIndex == index + value: model.domainObject + } + MouseArea { anchors.fill: parent onClicked: { listView.currentIndex = model.index - root.currentMail = model.domainObject } } diff --git a/applications/kube-mail/package/contents/ui/main.qml b/applications/kube-mail/package/contents/ui/main.qml index c1e3fcc3..ed8c7d17 100644 --- a/applications/kube-mail/package/contents/ui/main.qml +++ b/applications/kube-mail/package/contents/ui/main.qml @@ -123,6 +123,7 @@ ApplicationWindow { width: unit.size * 80 Layout.maximumWidth: unit.size * 250 Layout.minimumWidth: unit.size * 50 + focus: true } SingleMailView { -- cgit v1.2.3