diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-04-04 13:11:22 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-04-04 13:11:22 +0200 |
commit | ab3d462590e29488e2f5cff8338745347ff80742 (patch) | |
tree | 34c0f26ca61e88709106851a89f312277a5f9e27 | |
parent | 974b53f9df94d70a7f04080e181704111c2f294a (diff) | |
download | kube-ab3d462590e29488e2f5cff8338745347ff80742.tar.gz kube-ab3d462590e29488e2f5cff8338745347ff80742.zip |
Keyboard navigation in conversation view.
One problem with the current setting is that j/k is used for scrolling
in the conversation view, but for moving to the next mail in the
maillist view. To normalize this we could be using j/k for moving to the
next conversation instead, and n/p to go to the next/previous mail,
which is also what gmail does.
-rw-r--r-- | framework/qml/ConversationView.qml | 8 | ||||
-rw-r--r-- | framework/qml/MailListView.qml | 10 | ||||
-rw-r--r-- | framework/qml/Messages.qml | 3 |
3 files changed, 21 insertions, 0 deletions
diff --git a/framework/qml/ConversationView.qml b/framework/qml/ConversationView.qml index 4aa2b2c0..8331e581 100644 --- a/framework/qml/ConversationView.qml +++ b/framework/qml/ConversationView.qml | |||
@@ -62,9 +62,17 @@ FocusScope { | |||
62 | 62 | ||
63 | Keys.onPressed: { | 63 | Keys.onPressed: { |
64 | if (event.text == "j" || event.matches(StandardKey.MoveToNextLine)) { | 64 | if (event.text == "j" || event.matches(StandardKey.MoveToNextLine)) { |
65 | listView.scrollDown() | ||
66 | } else if (event.text == "J" || event.matches(StandardKey.MoveToNextPage)) { | ||
65 | listView.incrementCurrentIndex() | 67 | listView.incrementCurrentIndex() |
66 | } else if (event.text == "k" || event.matches(StandardKey.MoveToPreviousLine)) { | 68 | } else if (event.text == "k" || event.matches(StandardKey.MoveToPreviousLine)) { |
69 | listView.scrollUp() | ||
70 | } else if (event.text == "K" || event.matches(StandardKey.MoveToPreviousPage)) { | ||
67 | listView.decrementCurrentIndex() | 71 | listView.decrementCurrentIndex() |
72 | } else if (event.text == "n") { | ||
73 | Kube.Fabric.postMessage(Kube.Messages.nextConversation, {}) | ||
74 | } else if (event.text == "p") { | ||
75 | Kube.Fabric.postMessage(Kube.Messages.previousConversation, {}) | ||
68 | } else if (event.text == "d") { | 76 | } else if (event.text == "d") { |
69 | //Not implemented as a shortcut because we want it only to apply if we have the focus | 77 | //Not implemented as a shortcut because we want it only to apply if we have the focus |
70 | Kube.Fabric.postMessage(Kube.Messages.moveToTrash, {"mail": listView.currentItem.currentData.mail}) | 78 | Kube.Fabric.postMessage(Kube.Messages.moveToTrash, {"mail": listView.currentItem.currentData.mail}) |
diff --git a/framework/qml/MailListView.qml b/framework/qml/MailListView.qml index eb124102..ff72a59c 100644 --- a/framework/qml/MailListView.qml +++ b/framework/qml/MailListView.qml | |||
@@ -60,6 +60,16 @@ FocusScope { | |||
60 | text: qsTr("Nothing here...") | 60 | text: qsTr("Nothing here...") |
61 | } | 61 | } |
62 | 62 | ||
63 | Kube.Listener { | ||
64 | filter: Kube.Messages.nextConversation | ||
65 | onMessageReceived: listView.incrementCurrentIndex() | ||
66 | } | ||
67 | |||
68 | Kube.Listener { | ||
69 | filter: Kube.Messages.previousConversation | ||
70 | onMessageReceived: listView.decrementCurrentIndex() | ||
71 | } | ||
72 | |||
63 | ColumnLayout { | 73 | ColumnLayout { |
64 | anchors.fill: parent | 74 | anchors.fill: parent |
65 | 75 | ||
diff --git a/framework/qml/Messages.qml b/framework/qml/Messages.qml index 35aa750a..a3f6ef00 100644 --- a/framework/qml/Messages.qml +++ b/framework/qml/Messages.qml | |||
@@ -51,5 +51,8 @@ Item { | |||
51 | property string sendOutbox: "sendOutbox" | 51 | property string sendOutbox: "sendOutbox" |
52 | 52 | ||
53 | property string componentDone: "done" | 53 | property string componentDone: "done" |
54 | |||
55 | property string nextConversation: "nextConversation" | ||
56 | property string previousConversation: "previousConversation" | ||
54 | } | 57 | } |
55 | 58 | ||