aboutsummaryrefslogtreecommitdiff
path: root/MetaTerm.qml
diff options
context:
space:
mode:
authorAdrian Kummerlaender2015-06-21 20:21:50 +0200
committerAdrian Kummerlaender2015-06-21 20:21:50 +0200
commit97e3cfada0d599fe6121d92d52e4782fc02aed08 (patch)
treea351ca7412489152af3f127bcfe6f0180d17a928 /MetaTerm.qml
downloadMetaTerm-97e3cfada0d599fe6121d92d52e4782fc02aed08.tar
MetaTerm-97e3cfada0d599fe6121d92d52e4782fc02aed08.tar.gz
MetaTerm-97e3cfada0d599fe6121d92d52e4782fc02aed08.tar.bz2
MetaTerm-97e3cfada0d599fe6121d92d52e4782fc02aed08.tar.lz
MetaTerm-97e3cfada0d599fe6121d92d52e4782fc02aed08.tar.xz
MetaTerm-97e3cfada0d599fe6121d92d52e4782fc02aed08.tar.zst
MetaTerm-97e3cfada0d599fe6121d92d52e4782fc02aed08.zip
Initial commit of _MetaTerm_ UI prototype
MetaTerm is a meta terminal in the sense that it allows launching multiple terminal shells and applications in a unified interface that is in itself reminiscent of a terminal shell.
Diffstat (limited to 'MetaTerm.qml')
-rw-r--r--MetaTerm.qml76
1 files changed, 76 insertions, 0 deletions
diff --git a/MetaTerm.qml b/MetaTerm.qml
new file mode 100644
index 0000000..f95baa7
--- /dev/null
+++ b/MetaTerm.qml
@@ -0,0 +1,76 @@
+import QtQuick 2.0
+import QMLTermWidget 1.0
+import QtQuick.Controls 1.2
+
+Rectangle {
+ anchors.fill: parent
+
+ color: "#161616"
+
+ Flickable {
+ id: terminalListFlickable
+ boundsBehavior: Flickable.StopAtBounds
+ width: 600
+ anchors.fill: parent
+
+ Column {
+ id: terminalList
+ spacing: 10
+
+ property int activeItem : 0
+
+ function createItem() {
+ var terminalItem = Qt.createComponent("TerminalItem.qml");
+ var instantiateTerminal = function() {
+ var instance = terminalItem.createObject(terminalList, {
+ "width": terminalListFlickable.width
+ });
+ instance.onExecuted.connect(createItem);
+ }
+
+ if ( terminalItem.status == Component.Ready ) {
+ instantiateTerminal();
+ } else {
+ terminalItem.statusChanged.connect(instantiateTerminal);
+ }
+ }
+
+ function nextItem() {
+ if ( activeItem < (children.length - 1) ) {
+ children[++activeItem].focus();
+ }
+ }
+
+ function prevItem() {
+ if ( activeItem > 0 ) {
+ children[--activeItem].focus();
+ }
+ }
+
+ TerminalItem {
+ width: terminalListFlickable.width
+ onExecuted: terminalList.createItem()
+ }
+ }
+
+ contentHeight: terminalList.height
+ contentWidth: terminalList.width
+ }
+
+ Action {
+ id: nextTerminalAction
+ shortcut: "j"
+ onTriggered: terminalList.nextItem()
+ }
+
+ Action {
+ id: prevTerminalAction
+ shortcut: "k"
+ onTriggered: terminalList.prevItem()
+ }
+
+ ScrollBar {
+ flickable: terminalListFlickable
+ handleSize: 10
+ }
+}