summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--framework/qml/View.qml34
-rw-r--r--views/conversation/qml/View.qml34
2 files changed, 38 insertions, 30 deletions
diff --git a/framework/qml/View.qml b/framework/qml/View.qml
index 88cc3f10..29798f35 100644
--- a/framework/qml/View.qml
+++ b/framework/qml/View.qml
@@ -24,26 +24,36 @@ import QtQuick.Layouts 1.1
24import org.kube.framework 1.0 as Kube 24import org.kube.framework 1.0 as Kube
25 25
26FocusScope { 26FocusScope {
27 id: container 27 id: root
28
29 property int visibleViews: 2
30 property int currentIndex: 0
31 property int count: contentItems.length
32 default property alias contentItems: content.data
33 28
29 //Search
34 property rect searchArea: null 30 property rect searchArea: null
35 property string filter: "" 31 property string filter: ""
36 property var searchObject: null 32 property var searchObject: null
37 function triggerSearch() { 33 function triggerSearch() {
38 root.searchObject = searchComponent.createObject(root) 34 searchObject = searchComponent.createObject(root)
39 } 35 }
40 function clearSearch() { 36 function clearSearch() {
41 if (root.searchObject) { 37 if (searchObject) {
42 root.searchObject.close() 38 searchObject.close()
43 root.searchObject = null 39 searchObject = null
44 } 40 }
45 } 41 }
46 42
43 //Help
44 property Component helpViewComponent: null
45 function showHelp() {
46 if (helpViewComponent) {
47 helpViewComponent.createObject(root).open()
48 }
49 }
50
51 //View columns
52 property int visibleViews: 2
53 property int currentIndex: 0
54 property int count: contentItems.length
55 default property alias contentItems: content.data
56
47 property bool __aborted: false 57 property bool __aborted: false
48 58
49 //This signal will be emitted once all initial properties have been set and the view is ready to load 59 //This signal will be emitted once all initial properties have been set and the view is ready to load
@@ -97,8 +107,8 @@ FocusScope {
97 107
98 Kube.IconButton { 108 Kube.IconButton {
99 anchors { 109 anchors {
100 top: container.top 110 top: root.top
101 left: container.left 111 left: root.left
102 } 112 }
103 z: 1 113 z: 1
104 color: Kube.Colors.darkBackgroundColor 114 color: Kube.Colors.darkBackgroundColor
diff --git a/views/conversation/qml/View.qml b/views/conversation/qml/View.qml
index 2a5e3d0c..7463d5e2 100644
--- a/views/conversation/qml/View.qml
+++ b/views/conversation/qml/View.qml
@@ -41,6 +41,21 @@ Kube.View {
41 onMessageReceived: root.triggerSearch() 41 onMessageReceived: root.triggerSearch()
42 } 42 }
43 43
44 helpViewComponent: Kube.HelpPopup {
45 ListModel {
46 ListElement { description: qsTr("Jump to next thread:"); shortcut: "j" }
47 ListElement { description: qsTr("Jump to previous thread:"); shortcut: "k" }
48 ListElement { description: qsTr("Jump to next message:"); shortcut: "n" }
49 ListElement { description: qsTr("Jump to previous message:"); shortcut: "p" }
50 ListElement { description: qsTr("Jump to next folder:"); shortcut: "f,n" }
51 ListElement { description: qsTr("Jump to previous previous folder:"); shortcut: "f,p" }
52 ListElement { description: qsTr("Compose new message:"); shortcut: "c" }
53 ListElement { description: qsTr("Reply to the currently focused message:"); shortcut: "r" }
54 ListElement { description: qsTr("Delete the currently focused message:"); shortcut: "d" }
55 ListElement { description: qsTr("Show this help text:"); shortcut: "?" }
56 }
57 }
58
44 Shortcut { 59 Shortcut {
45 sequences: ['j'] 60 sequences: ['j']
46 onActivated: Kube.Fabric.postMessage(Kube.Messages.selectNextConversation, {}) 61 onActivated: Kube.Fabric.postMessage(Kube.Messages.selectNextConversation, {})
@@ -79,7 +94,7 @@ Kube.View {
79 } 94 }
80 Shortcut { 95 Shortcut {
81 sequence: "?" 96 sequence: "?"
82 onActivated: helpViewComponent.createObject(root).open() 97 onActivated: root.showHelp()
83 } 98 }
84 99
85 100
@@ -203,21 +218,4 @@ Kube.View {
203 } 218 }
204 } 219 }
205 220
206 Component {
207 id: helpViewComponent
208 Kube.HelpPopup {
209 ListModel {
210 ListElement { description: qsTr("Jump to next thread:"); shortcut: "j" }
211 ListElement { description: qsTr("Jump to previous thread:"); shortcut: "k" }
212 ListElement { description: qsTr("Jump to next message:"); shortcut: "n" }
213 ListElement { description: qsTr("Jump to previous message:"); shortcut: "p" }
214 ListElement { description: qsTr("Jump to next folder:"); shortcut: "f,n" }
215 ListElement { description: qsTr("Jump to previous previous folder:"); shortcut: "f,p" }
216 ListElement { description: qsTr("Compose new message:"); shortcut: "c" }
217 ListElement { description: qsTr("Reply to the currently focused message:"); shortcut: "r" }
218 ListElement { description: qsTr("Delete the currently focused message:"); shortcut: "d" }
219 ListElement { description: qsTr("Show this help text:"); shortcut: "?" }
220 }
221 }
222 }
223} 221}