Add new settings to control background image path and tint

This commit is contained in:
Reed Johns 2025-02-24 11:55:25 -07:00
parent 1ef50fb48f
commit f2e981e89d
2 changed files with 17 additions and 1 deletions

View File

@ -66,6 +66,9 @@ QtObject {
property real contrast: 0.80
property real brightness: 0.5
property string backgroundImage: ""
property real backgroundTint: 0.0
property bool useCustomCommand: false
property string customCommand: ""
@ -249,6 +252,8 @@ QtObject {
function composeProfileObject() {
var settings = {
"backgroundImage": backgroundImage
"backgroundTint": backgroundTint
"backgroundColor": _backgroundColor,
"fontColor": _fontColor,
"flickering": flickering,
@ -342,6 +347,11 @@ QtObject {
function loadProfileString(profileString) {
var settings = JSON.parse(profileString)
backgroundImage = settings.backgroundImage
!== undefined ? settings.backgroundImage : backgroundImage
backgroundTint = settings.backgroundTint
!== undefined ? settings.backgroundTint : backgroundTint
_backgroundColor = settings.backgroundColor
!== undefined ? settings.backgroundColor : _backgroundColor
_fontColor = settings.fontColor !== undefined ? settings.fontColor : _fontColor

View File

@ -26,10 +26,16 @@ import QtGraphicalEffects 1.0
ApplicationWindow{
style: ApplicationWindowStyle {
background: Image {
source: "file:background.png"
source: "file:///" + "appSettings.backgroundImage"
fillMode: Image.PreserveAspectCrop
smooth: false
}
Rectangle {
color: "black"
opacity: appSettings.backgroundTint
anchors.fill: parent
}
}
id: terminalWindow