diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-04-09 12:42:54 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-04-09 12:42:54 +0200 |
commit | bb4be57d21a47f9d975edd2beb9578e0f54b83df (patch) | |
tree | 34bb8c595c8cf3d397ae7742fa71b19c8894c047 | |
parent | de82b132907110a884239709dea43e08867501d8 (diff) | |
download | kube-bb4be57d21a47f9d975edd2beb9578e0f54b83df.tar.gz kube-bb4be57d21a47f9d975edd2beb9578e0f54b83df.zip |
Added scrolling shortcuts
-rw-r--r-- | framework/qml/ConversationListView.qml | 8 | ||||
-rw-r--r-- | framework/qml/ConversationView.qml | 10 | ||||
-rw-r--r-- | framework/qml/Messages.qml | 2 | ||||
-rw-r--r-- | views/conversation/qml/View.qml | 8 |
4 files changed, 28 insertions, 0 deletions
diff --git a/framework/qml/ConversationListView.qml b/framework/qml/ConversationListView.qml index 1d408edc..c84bbf6d 100644 --- a/framework/qml/ConversationListView.qml +++ b/framework/qml/ConversationListView.qml | |||
@@ -37,6 +37,14 @@ FocusScope { | |||
37 | 37 | ||
38 | property var currentItem: null | 38 | property var currentItem: null |
39 | 39 | ||
40 | function scrollDown() { | ||
41 | scrollHelper.scrollDown() | ||
42 | } | ||
43 | |||
44 | function scrollUp() { | ||
45 | scrollHelper.scrollUp() | ||
46 | } | ||
47 | |||
40 | function setCurrentItem() { | 48 | function setCurrentItem() { |
41 | if (currentItem) { | 49 | if (currentItem) { |
42 | currentItem.isCurrentItem = false | 50 | currentItem.isCurrentItem = false |
diff --git a/framework/qml/ConversationView.qml b/framework/qml/ConversationView.qml index 1109ad8e..fc239d40 100644 --- a/framework/qml/ConversationView.qml +++ b/framework/qml/ConversationView.qml | |||
@@ -54,6 +54,16 @@ FocusScope { | |||
54 | } | 54 | } |
55 | } | 55 | } |
56 | 56 | ||
57 | Kube.Listener { | ||
58 | filter: Kube.Messages.scrollConversationDown | ||
59 | onMessageReceived: listView.scrollDown() | ||
60 | } | ||
61 | |||
62 | Kube.Listener { | ||
63 | filter: Kube.Messages.scrollConversationUp | ||
64 | onMessageReceived: listView.scrollUp() | ||
65 | } | ||
66 | |||
57 | Rectangle { | 67 | Rectangle { |
58 | anchors.fill: parent | 68 | anchors.fill: parent |
59 | color: Kube.Colors.backgroundColor | 69 | color: Kube.Colors.backgroundColor |
diff --git a/framework/qml/Messages.qml b/framework/qml/Messages.qml index 630d05ab..1483a71c 100644 --- a/framework/qml/Messages.qml +++ b/framework/qml/Messages.qml | |||
@@ -58,5 +58,7 @@ Item { | |||
58 | property string selectPreviousMessage: "selectPreviousMessage" | 58 | property string selectPreviousMessage: "selectPreviousMessage" |
59 | property string selectNextFolder: "selectNextFolder" | 59 | property string selectNextFolder: "selectNextFolder" |
60 | property string selectPreviousFolder: "selectPreviousFolder" | 60 | property string selectPreviousFolder: "selectPreviousFolder" |
61 | property string scrollConversationDown: "scrollConversationDown" | ||
62 | property string scrollConversationUp: "scrollConversationUp" | ||
61 | } | 63 | } |
62 | 64 | ||
diff --git a/views/conversation/qml/View.qml b/views/conversation/qml/View.qml index 4cfac3df..088b7ae5 100644 --- a/views/conversation/qml/View.qml +++ b/views/conversation/qml/View.qml | |||
@@ -38,6 +38,14 @@ FocusScope { | |||
38 | onActivated: Kube.Fabric.postMessage(Kube.Messages.selectPreviousConversation, {}) | 38 | onActivated: Kube.Fabric.postMessage(Kube.Messages.selectPreviousConversation, {}) |
39 | } | 39 | } |
40 | Shortcut { | 40 | Shortcut { |
41 | sequences: ['Shift+J'] | ||
42 | onActivated: Kube.Fabric.postMessage(Kube.Messages.scrollConversationDown, {}) | ||
43 | } | ||
44 | Shortcut { | ||
45 | sequences: ['Shift+K'] | ||
46 | onActivated: Kube.Fabric.postMessage(Kube.Messages.scrollConversationUp, {}) | ||
47 | } | ||
48 | Shortcut { | ||
41 | sequences: ['n'] | 49 | sequences: ['n'] |
42 | onActivated: Kube.Fabric.postMessage(Kube.Messages.selectNextMessage, {}) | 50 | onActivated: Kube.Fabric.postMessage(Kube.Messages.selectNextMessage, {}) |
43 | } | 51 | } |