From 97e3cfada0d599fe6121d92d52e4782fc02aed08 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Sun, 21 Jun 2015 20:21:50 +0200 Subject: 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. --- MetaTerm.qml | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 MetaTerm.qml (limited to 'MetaTerm.qml') 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 + } +} -- cgit v1.2.3