aboutsummaryrefslogtreecommitdiff
path: root/qml/TerminalItem.qml
diff options
context:
space:
mode:
authorAdrian Kummerlaender2015-07-26 22:23:08 +0200
committerAdrian Kummerlaender2015-07-26 22:23:08 +0200
commite2d2c1232d10511693d058e0790183ba57ecd5d1 (patch)
treeb783c60b19eadc8db54c54d7a4ab7b0ee5c5f504 /qml/TerminalItem.qml
parent3af7553b2e7cf4f301d61eeac563f07bd405c66c (diff)
downloadMetaTerm-e2d2c1232d10511693d058e0790183ba57ecd5d1.tar
MetaTerm-e2d2c1232d10511693d058e0790183ba57ecd5d1.tar.gz
MetaTerm-e2d2c1232d10511693d058e0790183ba57ecd5d1.tar.bz2
MetaTerm-e2d2c1232d10511693d058e0790183ba57ecd5d1.tar.lz
MetaTerm-e2d2c1232d10511693d058e0790183ba57ecd5d1.tar.xz
MetaTerm-e2d2c1232d10511693d058e0790183ba57ecd5d1.tar.zst
MetaTerm-e2d2c1232d10511693d058e0790183ba57ecd5d1.zip
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.
Diffstat (limited to 'qml/TerminalItem.qml')
-rw-r--r--qml/TerminalItem.qml27
1 files changed, 19 insertions, 8 deletions
diff --git a/qml/TerminalItem.qml b/qml/TerminalItem.qml
index eeeed1c..f81df93 100644
--- a/qml/TerminalItem.qml
+++ b/qml/TerminalItem.qml
@@ -1,6 +1,7 @@
import QtQuick 2.0
import QtQuick.Controls 1.2
import QtQuick.Layouts 1.1
+import Qt.labs.settings 1.0
Item {
id: item
@@ -10,6 +11,15 @@ Item {
signal executed (int index)
+ Settings {
+ id: settings
+ category: "item"
+
+ property int fontSize : 18
+ property string fontFamily : "Monospace"
+ property color fontColor : "white"
+ }
+
anchors {
left: parent.left
right: parent.right
@@ -126,15 +136,16 @@ Item {
id: command
font {
- family: "Monospace"
- pointSize: 18
+ family: settings.fontFamily
+ pointSize: settings.fontSize
}
- color: "white"
- selectionColor: "white"
+
+ color: settings.fontColor
+ selectionColor: settings.fontColor
selectedTextColor: "#161616"
- selectByMouse: true
- focus: true
+ selectByMouse: true
+ focus: true
Layout.fillWidth: true
onAccepted: {
@@ -152,10 +163,10 @@ Item {
Text {
text: item.index
font {
- family: "Monospace"
+ family: settings.fontFamily
pointSize: 12
}
- color: "white"
+ color: settings.fontColor
}
}
}