aboutsummaryrefslogtreecommitdiff
path: root/qml/EmbeddedTerminal.qml
diff options
context:
space:
mode:
authorAdrian Kummerlaender2015-08-04 15:34:25 +0200
committerAdrian Kummerlaender2015-08-04 15:34:25 +0200
commit15cb0bd6b253673e02f3072c5fe604322da87467 (patch)
treeea00e954e332d4b4aa6f3c410706678553e3d333 /qml/EmbeddedTerminal.qml
parentb1305646f8f77c19242b8241e29b09b9312aa8ca (diff)
downloadMetaTerm-15cb0bd6b253673e02f3072c5fe604322da87467.tar
MetaTerm-15cb0bd6b253673e02f3072c5fe604322da87467.tar.gz
MetaTerm-15cb0bd6b253673e02f3072c5fe604322da87467.tar.bz2
MetaTerm-15cb0bd6b253673e02f3072c5fe604322da87467.tar.lz
MetaTerm-15cb0bd6b253673e02f3072c5fe604322da87467.tar.xz
MetaTerm-15cb0bd6b253673e02f3072c5fe604322da87467.tar.zst
MetaTerm-15cb0bd6b253673e02f3072c5fe604322da87467.zip
Added overlay background and font color to settings
This is required as the default white on black may not fit e.g. bright color schemes.
Diffstat (limited to 'qml/EmbeddedTerminal.qml')
-rw-r--r--qml/EmbeddedTerminal.qml45
1 files changed, 24 insertions, 21 deletions
diff --git a/qml/EmbeddedTerminal.qml b/qml/EmbeddedTerminal.qml
index 382a781..9b89fd1 100644
--- a/qml/EmbeddedTerminal.qml
+++ b/qml/EmbeddedTerminal.qml
@@ -13,11 +13,13 @@ Item {
id: settings
category: "terminal"
- property int initialLines : 20
- property int frameWidth : 10
- property int fontSize : 8
- property string fontFamily : "Monospace"
- property string colorScheme : "cool-retro-term"
+ property int initialLines : 20
+ property int frameWidth : 10
+ property int fontSize : 8
+ property string fontFamily : "Monospace"
+ property string colorScheme : "cool-retro-term"
+ property color overlayBackground : "black"
+ property color overlayFontColor : "white"
}
property int lines : settings.initialLines
@@ -73,6 +75,12 @@ Item {
}
}
+ Component.onCompleted: {
+ forceActiveFocus();
+ highlighter.select();
+ session.startShellProgram();
+ }
+
onTermGetFocus: highlighter.focus()
onTermLostFocus: highlighter.unfocus()
onHeightChanged: overlay.displayBriefly();
@@ -87,17 +95,18 @@ Item {
anchors.fill: parent
opacity: 0
- color: "black"
+ color: settings.overlayBackground
NumberAnimation {
id: animation
- target: overlay
+
+ target: overlay
property: "opacity"
easing.type: Easing.InSine
duration: 500
- from: 0.8
- to: 0
+ from: 0.8
+ to: 0
}
Text {
@@ -106,17 +115,17 @@ Item {
verticalCenter: overlay.verticalCenter
}
+ font {
+ family: settings.fontFamily
+ pointSize: 16
+ }
+ color: settings.overlayFontColor
+
text: {
return item.lines
+ 'x'
+ Math.floor(terminal.width / terminal.fontMetrics.width);
}
-
- font {
- family: settings.fontFamily
- pointSize: 16
- }
- color: "white"
}
}
@@ -125,12 +134,6 @@ Item {
acceptedButtons: Qt.NoButton
onWheel: { }
}
-
- Component.onCompleted: {
- forceActiveFocus();
- highlighter.select();
- session.startShellProgram();
- }
}
}
}