summaryrefslogtreecommitdiffstats
path: root/framework/qml/ConversationView.qml
diff options
context:
space:
mode:
Diffstat (limited to 'framework/qml/ConversationView.qml')
-rw-r--r--framework/qml/ConversationView.qml36
1 files changed, 20 insertions, 16 deletions
diff --git a/framework/qml/ConversationView.qml b/framework/qml/ConversationView.qml
index 8331e581..1109ad8e 100644
--- a/framework/qml/ConversationView.qml
+++ b/framework/qml/ConversationView.qml
@@ -17,7 +17,7 @@
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */ 18 */
19 19
20import QtQuick 2.7 20import QtQuick 2.9
21import QtQuick.Controls 2 21import QtQuick.Controls 2
22import QtQuick.Layouts 1.1 22import QtQuick.Layouts 1.1
23import org.kube.framework 1.0 as Kube 23import org.kube.framework 1.0 as Kube
@@ -38,6 +38,22 @@ FocusScope {
38 onMessageReceived: root.searchString = message.searchString 38 onMessageReceived: root.searchString = message.searchString
39 } 39 }
40 40
41 Kube.Listener {
42 filter: Kube.Messages.selectNextMessage
43 onMessageReceived: {
44 listView.incrementCurrentIndex()
45 listView.forceActiveFocus()
46 }
47 }
48
49 Kube.Listener {
50 filter: Kube.Messages.selectPreviousMessage
51 onMessageReceived: {
52 listView.decrementCurrentIndex()
53 listView.forceActiveFocus()
54 }
55 }
56
41 Rectangle { 57 Rectangle {
42 anchors.fill: parent 58 anchors.fill: parent
43 color: Kube.Colors.backgroundColor 59 color: Kube.Colors.backgroundColor
@@ -61,21 +77,9 @@ FocusScope {
61 } 77 }
62 78
63 Keys.onPressed: { 79 Keys.onPressed: {
64 if (event.text == "j" || event.matches(StandardKey.MoveToNextLine)) { 80 if (event.text == "d") {
65 listView.scrollDown() 81 //Not implemented as a shortcut because we want it only to apply if we have the focus
66 } else if (event.text == "J" || event.matches(StandardKey.MoveToNextPage)) { 82 Kube.Fabric.postMessage(Kube.Messages.moveToTrash, {"mail": listView.currentItem.currentData.mail})
67 listView.incrementCurrentIndex()
68 } else if (event.text == "k" || event.matches(StandardKey.MoveToPreviousLine)) {
69 listView.scrollUp()
70 } else if (event.text == "K" || event.matches(StandardKey.MoveToPreviousPage)) {
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, {})
76 } else if (event.text == "d") {
77 //Not implemented as a shortcut because we want it only to apply if we have the focus
78 Kube.Fabric.postMessage(Kube.Messages.moveToTrash, {"mail": listView.currentItem.currentData.mail})
79 } 83 }
80 } 84 }
81 85