From e2d2c1232d10511693d058e0790183ba57ecd5d1 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Sun, 26 Jul 2015 22:23:08 +0200 Subject: Extended available settings and changed them to value properties Otherwise each runtime change of a property leads to storing the new value to disk which we don't want - setting changes should be explicit and visible as such. --- qml/EmbeddedTerminal.qml | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'qml/EmbeddedTerminal.qml') diff --git a/qml/EmbeddedTerminal.qml b/qml/EmbeddedTerminal.qml index ef53b12..7e021b3 100644 --- a/qml/EmbeddedTerminal.qml +++ b/qml/EmbeddedTerminal.qml @@ -9,21 +9,22 @@ Item { property string program property string workingDirectory - property int lines : 20 - property int frameWidth : 10 - - height: terminal.height - width: parent.width - frameWidth - Settings { + id: settings category: "terminal" - property alias frameWidth : item.frameWidth - property alias colorScheme : terminal.colorScheme - property alias fontFamily : terminal.font.family - property alias fontSize : terminal.font.pointSize + property int initialLines : 20 + property int frameWidth : 10 + property int fontSize : 8 + property string fontFamily : "Monospace" + property string colorScheme : "cool-retro-term" } + property int lines : settings.initialLines + + height: terminal.height + width: parent.width - settings.frameWidth + function select() { highlighter.select() } function deselect() { highlighter.deselect() } @@ -40,7 +41,7 @@ Item { Highlighter { id: highlighter - width: item.frameWidth + width: settings.frameWidth Layout.fillHeight: true } @@ -48,14 +49,14 @@ Item { id: terminal font { - family: "Monospace" - pointSize: 8 + family: settings.fontFamily + pointSize: settings.fontSize } Layout.fillWidth: true Layout.preferredHeight: fontMetrics.height * item.lines - colorScheme: "cool-retro-term" + colorScheme: settings.colorScheme session: QMLTermSession { initialWorkingDirectory: item.workingDirectory -- cgit v1.2.3