From 1562641cc744ff9d6c0e0fd0ce1936010331000f Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Mon, 14 Dec 2015 20:50:43 +0100 Subject: Extract terminal status line into separate QML item --- src/widget/StatusLine.qml | 76 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 src/widget/StatusLine.qml (limited to 'src/widget/StatusLine.qml') diff --git a/src/widget/StatusLine.qml b/src/widget/StatusLine.qml new file mode 100644 index 0000000..56b0b31 --- /dev/null +++ b/src/widget/StatusLine.qml @@ -0,0 +1,76 @@ +import QtQuick 2.0 +import QMLTermWidget 1.0 +import QtQuick.Layouts 1.1 + +Item { + id: item + + property QMLTermSession session : null + + function update() { + var shellPID = session.getShellPID(); + + pid.text = shellPID; + workingDirectory.text = cwd.currentOfPID(shellPID); + } + + height: wrap.height + + RowLayout { + id: wrap + + anchors.right: parent.right + anchors.left: parent.left + + Layout.alignment: Qt.AlignRight + + spacing: 5 + + Rectangle { + Layout.fillWidth: true + + anchors.fill: wrap + + color: settings.terminal.statusBackground + } + + Text { + id: pid + + Layout.rightMargin: 4 + Layout.bottomMargin: 2 + + font { + family: settings.terminal.fontFamily + pointSize: settings.terminal.fontSize + } + color: settings.terminal.statusFontColor + } + + Text { + Layout.rightMargin: 4 + Layout.bottomMargin: 2 + + font { + family: settings.terminal.fontFamily + pointSize: settings.terminal.fontSize + } + color: settings.terminal.statusFontColor + + text: "@" + } + + Text { + id: workingDirectory + + Layout.rightMargin: 4 + Layout.bottomMargin: 2 + + font { + family: settings.terminal.fontFamily + pointSize: settings.terminal.fontSize + } + color: settings.terminal.statusFontColor + } + } +} -- cgit v1.2.3