diff options
-rw-r--r-- | framework/qml/HelpPopup.qml | 49 | ||||
-rw-r--r-- | framework/qmldir | 1 | ||||
-rw-r--r-- | views/conversation/qml/View.qml | 24 |
3 files changed, 73 insertions, 1 deletions
diff --git a/framework/qml/HelpPopup.qml b/framework/qml/HelpPopup.qml new file mode 100644 index 00000000..b1fe75a6 --- /dev/null +++ b/framework/qml/HelpPopup.qml | |||
@@ -0,0 +1,49 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2017 Michael Bohlender, <michael.bohlender@kdemail.net> | ||
3 | * Copyright (C) 2017 Christian Mollekopf, <mollekopf@kolabsys.com> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License along | ||
16 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
18 | */ | ||
19 | |||
20 | |||
21 | import QtQuick 2.9 | ||
22 | import QtQuick.Controls 2 | ||
23 | import QtQuick.Layouts 1.1 | ||
24 | |||
25 | import org.kube.framework 1.0 as Kube | ||
26 | |||
27 | |||
28 | Kube.Popup { | ||
29 | id: debugPopup | ||
30 | |||
31 | default property alias entries: view.model | ||
32 | |||
33 | modal: true | ||
34 | parent: ApplicationWindow.overlay | ||
35 | closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent | ||
36 | x: (parent.width - width)/2 | ||
37 | y: Kube.Units.largeSpacing | ||
38 | width: parent.width / 2 | ||
39 | height: parent.height - Kube.Units.largeSpacing * 2 | ||
40 | clip: true | ||
41 | |||
42 | ListView { | ||
43 | id: view | ||
44 | anchors.fill: parent | ||
45 | delegate: Kube.Label { | ||
46 | text: description + " " + shortcut | ||
47 | } | ||
48 | } | ||
49 | } | ||
diff --git a/framework/qmldir b/framework/qmldir index c62444c9..808563c9 100644 --- a/framework/qmldir +++ b/framework/qmldir | |||
@@ -10,6 +10,7 @@ NewAccountDialog 1.0 NewAccountDialog.qml | |||
10 | EditAccount 1.0 EditAccount.qml | 10 | EditAccount 1.0 EditAccount.qml |
11 | LoginAccount 1.0 LoginAccount.qml | 11 | LoginAccount 1.0 LoginAccount.qml |
12 | Outbox 1.0 Outbox.qml | 12 | Outbox 1.0 Outbox.qml |
13 | HelpPopup 1.0 HelpPopup.qml | ||
13 | NotificationPopup 1.0 NotificationPopup.qml | 14 | NotificationPopup 1.0 NotificationPopup.qml |
14 | Icon 1.0 Icon.qml | 15 | Icon 1.0 Icon.qml |
15 | IconButton 1.0 IconButton.qml | 16 | IconButton 1.0 IconButton.qml |
diff --git a/views/conversation/qml/View.qml b/views/conversation/qml/View.qml index c965b4c7..4cfac3df 100644 --- a/views/conversation/qml/View.qml +++ b/views/conversation/qml/View.qml | |||
@@ -20,12 +20,13 @@ | |||
20 | 20 | ||
21 | import QtQuick 2.9 | 21 | import QtQuick 2.9 |
22 | import QtQuick.Controls 1.3 as Controls1 | 22 | import QtQuick.Controls 1.3 as Controls1 |
23 | import QtQuick.Controls 2.0 as Controls2 | 23 | import QtQuick.Controls 2 |
24 | import QtQuick.Layouts 1.1 | 24 | import QtQuick.Layouts 1.1 |
25 | 25 | ||
26 | import org.kube.framework 1.0 as Kube | 26 | import org.kube.framework 1.0 as Kube |
27 | 27 | ||
28 | FocusScope { | 28 | FocusScope { |
29 | id: root | ||
29 | property alias currentAccount: accountFolderview.currentAccount | 30 | property alias currentAccount: accountFolderview.currentAccount |
30 | 31 | ||
31 | Shortcut { | 32 | Shortcut { |
@@ -56,6 +57,10 @@ FocusScope { | |||
56 | sequences: ['c'] | 57 | sequences: ['c'] |
57 | onActivated: Kube.Fabric.postMessage(Kube.Messages.compose, {}) | 58 | onActivated: Kube.Fabric.postMessage(Kube.Messages.compose, {}) |
58 | } | 59 | } |
60 | Shortcut { | ||
61 | sequence: "?" | ||
62 | onActivated: helpViewComponent.createObject(root).open() | ||
63 | } | ||
59 | 64 | ||
60 | 65 | ||
61 | Controls1.SplitView { | 66 | Controls1.SplitView { |
@@ -179,4 +184,21 @@ FocusScope { | |||
179 | 184 | ||
180 | } | 185 | } |
181 | } | 186 | } |
187 | |||
188 | Component { | ||
189 | id: helpViewComponent | ||
190 | Kube.HelpPopup { | ||
191 | ListModel { | ||
192 | ListElement { description: qsTr("Jump to next thread:"); shortcut: "j" } | ||
193 | ListElement { description: qsTr("Jump to previous thread:"); shortcut: "k" } | ||
194 | ListElement { description: qsTr("Jump to next message:"); shortcut: "n" } | ||
195 | ListElement { description: qsTr("Jump to previous message:"); shortcut: "p" } | ||
196 | ListElement { description: qsTr("Jump to next folder:"); shortcut: "f,n" } | ||
197 | ListElement { description: qsTr("Jump to previous previous folder:"); shortcut: "f,p" } | ||
198 | ListElement { description: qsTr("Compose new message:"); shortcut: "c" } | ||
199 | ListElement { description: qsTr("Show this help text:"); shortcut: "?" } | ||
200 | } | ||
201 | } | ||
202 | } | ||
203 | |||
182 | } | 204 | } |