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/TerminalItem.qml | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'qml/TerminalItem.qml') 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 } } } -- cgit v1.2.3