mirror of
https://github.com/Swordfish90/cool-retro-term.git
synced 2025-03-30 15:08:34 +00:00
Add new settings to control background image path and tint
This commit is contained in:
parent
1ef50fb48f
commit
f2e981e89d
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user