aboutsummaryrefslogtreecommitdiff
path: root/EmbeddedTerminal.qml
diff options
context:
space:
mode:
authorAdrian Kummerlaender2015-06-29 22:31:24 +0200
committerAdrian Kummerlaender2015-06-29 22:31:24 +0200
commitf01eadd3530e61063b43aa615123dcd82ce3d239 (patch)
treedc75476440857aa3ca4d914feff7bf923e2e2931 /EmbeddedTerminal.qml
parent97e3cfada0d599fe6121d92d52e4782fc02aed08 (diff)
downloadMetaTerm-f01eadd3530e61063b43aa615123dcd82ce3d239.tar
MetaTerm-f01eadd3530e61063b43aa615123dcd82ce3d239.tar.gz
MetaTerm-f01eadd3530e61063b43aa615123dcd82ce3d239.tar.bz2
MetaTerm-f01eadd3530e61063b43aa615123dcd82ce3d239.tar.lz
MetaTerm-f01eadd3530e61063b43aa615123dcd82ce3d239.tar.xz
MetaTerm-f01eadd3530e61063b43aa615123dcd82ce3d239.tar.zst
MetaTerm-f01eadd3530e61063b43aa615123dcd82ce3d239.zip
Added vim-like UI normal and insert modes
Normal mode allows for selecting the a terminal or newline text input. Insert mode sets the keyboard focus to the currently selected item. This transforms _MetaTerm_ into a fully keyboard driven application.
Diffstat (limited to 'EmbeddedTerminal.qml')
-rw-r--r--EmbeddedTerminal.qml20
1 files changed, 11 insertions, 9 deletions
diff --git a/EmbeddedTerminal.qml b/EmbeddedTerminal.qml
index e02ba61..f4f104e 100644
--- a/EmbeddedTerminal.qml
+++ b/EmbeddedTerminal.qml
@@ -12,7 +12,8 @@ Item {
width: container.width
height: container.height
- function focus() { terminal.forceActiveFocus() }
+ function select() { highlighter.select() }
+ function deselect() { highlighter.deselect() }
Row {
id: container
@@ -23,7 +24,7 @@ Item {
width: 10
height: terminal.height
- color: "#aadb0f"
+ color: "#909636"
Behavior on opacity {
NumberAnimation {
@@ -32,8 +33,10 @@ Item {
}
}
- function focus() { opacity = 1 }
- function unfocus() { opacity = 0 }
+ function select() { opacity = 1 }
+ function deselect() { opacity = 0 }
+ function focus() { color = "#352F6A" }
+ function unfocus() { color = "#909636" }
}
Rectangle {
@@ -66,16 +69,15 @@ Item {
}
}
+ onTermGetFocus: highlighter.focus()
+ onTermLostFocus: highlighter.unfocus()
+
MouseArea {
anchors.fill: parent
- acceptedButtons: Qt.LeftButton
- onClicked: parent.forceActiveFocus();
+ acceptedButtons: Qt.NoButton
onWheel: { }
}
- onTermGetFocus: highlighter.focus()
- onTermLostFocus: highlighter.unfocus()
-
Component.onCompleted: {
terminal.forceActiveFocus();
session.startShellProgram();