diff options
author | Adrian Kummerlaender | 2015-08-29 22:12:49 +0200 |
---|---|---|
committer | Adrian Kummerlaender | 2015-08-29 22:12:49 +0200 |
commit | 0dd49584e26c294e3fb25347969f61bca84afb5f (patch) | |
tree | e84adbe9014d155a185cc2f6539ef34732b6474f /src/widget/HistoryViewer.qml | |
parent | 77d4b29ffd337b747448ce0f1a6f6e3457d8cd05 (diff) | |
download | MetaTerm-0dd49584e26c294e3fb25347969f61bca84afb5f.tar MetaTerm-0dd49584e26c294e3fb25347969f61bca84afb5f.tar.gz MetaTerm-0dd49584e26c294e3fb25347969f61bca84afb5f.tar.bz2 MetaTerm-0dd49584e26c294e3fb25347969f61bca84afb5f.tar.lz MetaTerm-0dd49584e26c294e3fb25347969f61bca84afb5f.tar.xz MetaTerm-0dd49584e26c294e3fb25347969f61bca84afb5f.tar.zst MetaTerm-0dd49584e26c294e3fb25347969f61bca84afb5f.zip |
Automatically destroy terminal when killed and display history
Child processes of _MetaTerm_ may be terminated using other ways that the integrated kill command.
Automatic terminal widget destruction in such a event prevents the user from viewing the output of non-interactive applications.
This requires _MetaTerm_ to display the application's output after it was terminated.
This requirement is implemented via the new `HistoryViewer` widget that is instantiated after the terminal widget instance has been destroyed.
Diffstat (limited to 'src/widget/HistoryViewer.qml')
-rw-r--r-- | src/widget/HistoryViewer.qml | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/widget/HistoryViewer.qml b/src/widget/HistoryViewer.qml new file mode 100644 index 0000000..ca042f4 --- /dev/null +++ b/src/widget/HistoryViewer.qml @@ -0,0 +1,33 @@ +import QtQuick 2.0 +import QMLTermWidget 1.0 +import QtQuick.Layouts 1.1 + +Item { + id: item + + property string history + + height: viewer.height + width: parent.width - settings.terminal.frameWidth + + Text { + id: viewer + + anchors { + left: parent.left + leftMargin: settings.terminal.frameWidth + right: parent.right + } + + color: settings.item.fontColor + + font { + family: settings.terminal.fontFamily + pointSize: settings.terminal.fontSize + } + + Layout.fillWidth: true + + text: history.trim() + } +} |