aboutsummaryrefslogtreecommitdiff
path: root/qml/StateHandler.qml
diff options
context:
space:
mode:
authorAdrian Kummerlaender2015-07-27 15:04:53 +0200
committerAdrian Kummerlaender2015-07-27 15:04:53 +0200
commit39016bbc237171554a5a5b09575eb978f098b73d (patch)
tree66d30feeedefaa7b6fd731d306636054435b27eb /qml/StateHandler.qml
parente2d2c1232d10511693d058e0790183ba57ecd5d1 (diff)
downloadMetaTerm-39016bbc237171554a5a5b09575eb978f098b73d.tar
MetaTerm-39016bbc237171554a5a5b09575eb978f098b73d.tar.gz
MetaTerm-39016bbc237171554a5a5b09575eb978f098b73d.tar.bz2
MetaTerm-39016bbc237171554a5a5b09575eb978f098b73d.tar.lz
MetaTerm-39016bbc237171554a5a5b09575eb978f098b73d.tar.xz
MetaTerm-39016bbc237171554a5a5b09575eb978f098b73d.tar.zst
MetaTerm-39016bbc237171554a5a5b09575eb978f098b73d.zip
Enabled keybinding customization via settings
Diffstat (limited to 'qml/StateHandler.qml')
-rw-r--r--qml/StateHandler.qml34
1 files changed, 25 insertions, 9 deletions
diff --git a/qml/StateHandler.qml b/qml/StateHandler.qml
index 53ca3af..e2cbac0 100644
--- a/qml/StateHandler.qml
+++ b/qml/StateHandler.qml
@@ -1,11 +1,27 @@
import QtQuick 2.0
import QtQuick.Controls 1.2
+import Qt.labs.settings 1.0
Item {
id: item
property Item terminalList : null
+ Settings {
+ id: settings
+ category: "keybinding"
+
+ property string insertMode : "i"
+ property string normalMode : "Shift+ESC"
+ property string nextItem : "j"
+ property string prevItem : "k"
+ property string firstItem : "g"
+ property string resetItem : "d"
+ property string lastItem : "Shift+G"
+ property string heightenItem : "Shift+J"
+ property string shortenItem : "Shift+K"
+ }
+
state: "INSERT"
function enterInsertMode() {
@@ -43,7 +59,7 @@ Item {
Action {
id: insertTerminalAction
- shortcut: "i"
+ shortcut: settings.insertMode
onTriggered: {
item.state = "INSERT";
@@ -53,7 +69,7 @@ Item {
Action {
id: escapeTerminalAction
- shortcut: "Shift+ESC"
+ shortcut: settings.normalMode
onTriggered: {
item.state = "NORMAL";
@@ -64,43 +80,43 @@ Item {
Action {
id: nextTerminalAction
- shortcut: "j"
+ shortcut: settings.nextItem
onTriggered: terminalList.selectNext()
}
Action {
id: heightenTerminalAction
- shortcut: "Shift+J"
+ shortcut: settings.heightenItem
onTriggered: terminalList.getCurrent().heighten()
}
Action {
id: shortenTerminalAction
- shortcut: "Shift+K"
+ shortcut: settings.shortenItem
onTriggered: terminalList.getCurrent().shorten()
}
Action {
id: prevTerminalAction
- shortcut: "k"
+ shortcut: settings.prevItem
onTriggered: terminalList.selectPrev()
}
Action {
id: lastTerminalAction
- shortcut: "Shift+G"
+ shortcut: settings.lastItem
onTriggered: terminalList.selectItem(terminalList.children.length - 1)
}
Action {
id: firstTerminalAction
- shortcut: "g"
+ shortcut: settings.firstItem
onTriggered: terminalList.selectItem(0)
}
Action {
id: resetTerminalAction
- shortcut: "d"
+ shortcut: settings.resetItem
onTriggered: terminalList.getCurrent().reset()
}
}