From eca10a1bd5b1f6186d280848bc102e0503c7b487 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Sun, 19 Jul 2015 20:19:44 +0200 Subject: Removed unnecessary `QMLTermWidget` background rectangle The background color is set accordingly to the color scheme by the widget itself. --- qml/EmbeddedTerminal.qml | 62 ++++++++++++++++++++++-------------------------- 1 file changed, 29 insertions(+), 33 deletions(-) (limited to 'qml') diff --git a/qml/EmbeddedTerminal.qml b/qml/EmbeddedTerminal.qml index 0a878b7..1bfa725 100644 --- a/qml/EmbeddedTerminal.qml +++ b/qml/EmbeddedTerminal.qml @@ -46,51 +46,47 @@ Item { function unfocus() { color = "#909636" } } - Rectangle { - height: terminal.height - - Layout.fillWidth: true - Layout.preferredHeight: terminal.height + QMLTermWidget { + id: terminal - color: "#ffffff" + font.family: "Monospace" + font.pointSize: 8 - QMLTermWidget { - id: terminal + width: parent.width + height: fontMetrics.height * item.lines - font.family: "Monospace" - font.pointSize: 8 + Layout.fillWidth: true + Layout.preferredHeight: height - width: parent.width - height: fontMetrics.height * item.lines + colorScheme: "cool-retro-term" - session: QMLTermSession { - initialWorkingDirectory: item.workingDirectory + session: QMLTermSession { + initialWorkingDirectory: item.workingDirectory - shellProgram: { - return (item.program).split(" ")[0]; - } + shellProgram: { + return (item.program).split(" ")[0]; + } - shellProgramArgs: { - var elements = (item.program).split(" "); - elements.shift(); + shellProgramArgs: { + var elements = (item.program).split(" "); + elements.shift(); - return elements; - } + return elements; } + } - onTermGetFocus: highlighter.focus() - onTermLostFocus: highlighter.unfocus() + onTermGetFocus: highlighter.focus() + onTermLostFocus: highlighter.unfocus() - MouseArea { - anchors.fill: parent - acceptedButtons: Qt.NoButton - onWheel: { } - } + MouseArea { + anchors.fill: parent + acceptedButtons: Qt.NoButton + onWheel: { } + } - Component.onCompleted: { - forceActiveFocus(); - session.startShellProgram(); - } + Component.onCompleted: { + forceActiveFocus(); + session.startShellProgram(); } } } -- cgit v1.2.3