aboutsummaryrefslogtreecommitdiff
path: root/qml
diff options
context:
space:
mode:
authorAdrian Kummerlaender2015-07-26 20:54:57 +0200
committerAdrian Kummerlaender2015-07-26 20:54:57 +0200
commit3af7553b2e7cf4f301d61eeac563f07bd405c66c (patch)
treec85ad486864105d7da2214a5b560b4967de8f78d /qml
parent311dd6e4e885ff5833756fd9cfa6e8c9c4a8668a (diff)
downloadMetaTerm-3af7553b2e7cf4f301d61eeac563f07bd405c66c.tar
MetaTerm-3af7553b2e7cf4f301d61eeac563f07bd405c66c.tar.gz
MetaTerm-3af7553b2e7cf4f301d61eeac563f07bd405c66c.tar.bz2
MetaTerm-3af7553b2e7cf4f301d61eeac563f07bd405c66c.tar.lz
MetaTerm-3af7553b2e7cf4f301d61eeac563f07bd405c66c.tar.xz
MetaTerm-3af7553b2e7cf4f301d61eeac563f07bd405c66c.tar.zst
MetaTerm-3af7553b2e7cf4f301d61eeac563f07bd405c66c.zip
Added support for permanently storing settings
Diffstat (limited to 'qml')
-rw-r--r--qml/EmbeddedTerminal.qml21
-rw-r--r--qml/TerminalItem.qml1
-rw-r--r--qml/main.qml7
3 files changed, 24 insertions, 5 deletions
diff --git a/qml/EmbeddedTerminal.qml b/qml/EmbeddedTerminal.qml
index aa22328..ef53b12 100644
--- a/qml/EmbeddedTerminal.qml
+++ b/qml/EmbeddedTerminal.qml
@@ -1,18 +1,29 @@
import QtQuick 2.0
import QMLTermWidget 1.0
import QtQuick.Layouts 1.1
+import Qt.labs.settings 1.0
Item {
id: item
property string program
property string workingDirectory
- property int lines
+
+ property int lines : 20
property int frameWidth : 10
height: terminal.height
width: parent.width - frameWidth
+ 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
+ }
+
function select() { highlighter.select() }
function deselect() { highlighter.deselect() }
@@ -36,10 +47,12 @@ Item {
QMLTermWidget {
id: terminal
- font.family: "Monospace"
- font.pointSize: 8
+ font {
+ family: "Monospace"
+ pointSize: 8
+ }
- Layout.fillWidth: true
+ Layout.fillWidth: true
Layout.preferredHeight: fontMetrics.height * item.lines
colorScheme: "cool-retro-term"
diff --git a/qml/TerminalItem.qml b/qml/TerminalItem.qml
index 48fb9f7..eeeed1c 100644
--- a/qml/TerminalItem.qml
+++ b/qml/TerminalItem.qml
@@ -96,7 +96,6 @@ Item {
var terminalComponent = Qt.createComponent("qrc:/EmbeddedTerminal.qml");
var instantiateTerminal = function() {
item.terminal = terminalComponent.createObject(elementList, {
- "lines" : 20,
"program" : program,
"workingDirectory" : "$HOME",
"focus" : true
diff --git a/qml/main.qml b/qml/main.qml
index 836f97c..a45ee73 100644
--- a/qml/main.qml
+++ b/qml/main.qml
@@ -1,6 +1,7 @@
import QtQuick 2.0
import QtQuick.Window 2.0
import QtQuick.Controls 1.2
+import Qt.labs.settings 1.0
ApplicationWindow {
id: root
@@ -13,6 +14,12 @@ ApplicationWindow {
terminalList.focusCurrent();
}
+ Settings {
+ category: "window"
+
+ property alias color : root.color
+ }
+
Flickable {
id: terminalListFlickable