From ad6773b267e2bbdfc5e049a4bc8ac8b92980270e Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Fri, 21 Aug 2015 17:20:58 +0200 Subject: Add `q` command to close _MetaTerm_ in command mode --- src/command/CommandInput.qml | 12 ++++++------ src/command/commands.js | 36 ++++++++++++++++++++---------------- src/widget/EmbeddedTerminal.qml | 12 ++++++------ 3 files changed, 32 insertions(+), 28 deletions(-) diff --git a/src/command/CommandInput.qml b/src/command/CommandInput.qml index dbc1d54..3e6c46c 100644 --- a/src/command/CommandInput.qml +++ b/src/command/CommandInput.qml @@ -8,12 +8,6 @@ Item { signal executed - visible: false - - Layout.preferredHeight: container.height - - onVisibleChanged: container.reset() - function focus(prefix) { visible = true; command.text = prefix; @@ -24,6 +18,12 @@ Item { visible = false; } + visible: false + + Layout.preferredHeight: container.height + + onVisibleChanged: container.reset() + Rectangle { anchors { top: parent.top diff --git a/src/command/commands.js b/src/command/commands.js index fce509a..0855e3a 100644 --- a/src/command/commands.js +++ b/src/command/commands.js @@ -34,22 +34,6 @@ function exec(output, args) { } } -function jump(output, index) { - terminalList.selectItem(index); -} - -function kill(output, index) { - terminalList.get(index).reset(); -} - -function next() { - terminalList.selectNext(); -} - -function prev() { - terminalList.selectPrev(); -} - function ls(output) { terminalList.iterate(function(item) { if ( item.terminal !== null ) { @@ -74,3 +58,23 @@ function set(output, args) { } } } + +function jump(output, index) { + terminalList.selectItem(index); +} + +function kill(output, index) { + terminalList.get(index).reset(); +} + +function next() { + terminalList.selectNext(); +} + +function prev() { + terminalList.selectPrev(); +} + +function q() { + Qt.quit(); +} diff --git a/src/widget/EmbeddedTerminal.qml b/src/widget/EmbeddedTerminal.qml index 7b3cf10..fa30e23 100644 --- a/src/widget/EmbeddedTerminal.qml +++ b/src/widget/EmbeddedTerminal.qml @@ -5,18 +5,18 @@ import QtQuick.Layouts 1.1 Item { id: item - property string program - property string workingDirectory + property string program + property string workingDirectory - property int lines : settings.terminal.initialLines - - height: terminal.height - width: parent.width - settings.terminal.frameWidth + property int lines : settings.terminal.initialLines function select() { highlighter.select() } function deselect() { highlighter.deselect() } function displayOverlay() { overlay.displayBriefly() } + height: terminal.height + width: parent.width - settings.terminal.frameWidth + RowLayout { id: container -- cgit v1.2.3