mirror of
				https://github.com/Swordfish90/cool-retro-term.git
				synced 2025-10-31 07:04:20 +00:00 
			
		
		
		
	Finally we can set opacity! Yuuuuu.
This commit is contained in:
		| @@ -28,6 +28,7 @@ Item{ | |||||||
|  |  | ||||||
|     property bool fullscreen: false |     property bool fullscreen: false | ||||||
|  |  | ||||||
|  |     property real windowOpacity: 1.0 | ||||||
|     property real ambient_light: 0.2 |     property real ambient_light: 0.2 | ||||||
|     property real contrast: 0.85 |     property real contrast: 0.85 | ||||||
|     property real brightness: 0.5 |     property real brightness: 0.5 | ||||||
| @@ -160,7 +161,8 @@ Item{ | |||||||
|             ambient_light: ambient_light, |             ambient_light: ambient_light, | ||||||
|             fontScalingIndexes: fontScalingIndexes, |             fontScalingIndexes: fontScalingIndexes, | ||||||
|             fontIndexes: fontIndexes, |             fontIndexes: fontIndexes, | ||||||
|             frameReflections: _frameReflections |             frameReflections: _frameReflections, | ||||||
|  |             windowOpacity: windowOpacity | ||||||
|         } |         } | ||||||
|         return JSON.stringify(settings); |         return JSON.stringify(settings); | ||||||
|     } |     } | ||||||
| @@ -225,6 +227,7 @@ Item{ | |||||||
|         fontScalingIndexes = settings.fontScalingIndexes !== undefined ? settings.fontScalingIndexes : fontScalingIndexes |         fontScalingIndexes = settings.fontScalingIndexes !== undefined ? settings.fontScalingIndexes : fontScalingIndexes | ||||||
|  |  | ||||||
|         _frameReflections = settings.frameReflections !== undefined ? settings.frameReflections : _frameReflections; |         _frameReflections = settings.frameReflections !== undefined ? settings.frameReflections : _frameReflections; | ||||||
|  |         windowOpacity = settings.windowOpacity !== undefined ? settings.windowOpacity : windowOpacity; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     function loadProfileString(profileString){ |     function loadProfileString(profileString){ | ||||||
|   | |||||||
| @@ -197,7 +197,7 @@ Item{ | |||||||
|         id: blurredSource |         id: blurredSource | ||||||
|         sourceItem: blurredterminal |         sourceItem: blurredterminal | ||||||
|         recursive: true |         recursive: true | ||||||
|         live: true |         live: false | ||||||
|  |  | ||||||
|         smooth: false |         smooth: false | ||||||
|         antialiasing: false |         antialiasing: false | ||||||
| @@ -205,13 +205,11 @@ Item{ | |||||||
|         Timer{ |         Timer{ | ||||||
|             id: livetimer |             id: livetimer | ||||||
|             running: true |             running: true | ||||||
|             onTriggered: parent.live = false; |             onRunningChanged: running ? | ||||||
|  |                                   timeManager.onTimeChanged.connect(blurredSource.scheduleUpdate) : | ||||||
|  |                                   timeManager.onTimeChanged.disconnect(blurredSource.scheduleUpdate) | ||||||
|  |  | ||||||
|             function updateImageHandler(){ |             Component.onCompleted: kterminal.updatedImage.connect(restart); | ||||||
|                 livetimer.restart(); |  | ||||||
|                 blurredSource.live = true; |  | ||||||
|             } |  | ||||||
|             Component.onCompleted: kterminal.updatedImage.connect(updateImageHandler); |  | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|     ShaderEffectSource{ |     ShaderEffectSource{ | ||||||
| @@ -219,6 +217,7 @@ Item{ | |||||||
|         sourceItem: blurredterminal |         sourceItem: blurredterminal | ||||||
|         sourceRect: frame.sourceRect |         sourceRect: frame.sourceRect | ||||||
|         format: ShaderEffectSource.Alpha |         format: ShaderEffectSource.Alpha | ||||||
|  |         hideSource: true | ||||||
|     } |     } | ||||||
|     ShaderEffect { |     ShaderEffect { | ||||||
|         id: blurredterminal |         id: blurredterminal | ||||||
|   | |||||||
| @@ -89,6 +89,11 @@ Tab{ | |||||||
|                     onValueChanged: shadersettings.ambient_light = value; |                     onValueChanged: shadersettings.ambient_light = value; | ||||||
|                     value: shadersettings.ambient_light |                     value: shadersettings.ambient_light | ||||||
|                 } |                 } | ||||||
|  |                 Text{ text: qsTr("Opacity") } | ||||||
|  |                 SimpleSlider{ | ||||||
|  |                     onValueChanged: shadersettings.windowOpacity = value | ||||||
|  |                     value: shadersettings.windowOpacity | ||||||
|  |                 } | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|         GroupBox{ |         GroupBox{ | ||||||
|   | |||||||
| @@ -28,7 +28,7 @@ Window { | |||||||
|     id: settings_window |     id: settings_window | ||||||
|     title: qsTr("Settings") |     title: qsTr("Settings") | ||||||
|     width: 640 |     width: 640 | ||||||
|     height: 420 |     height: 450 | ||||||
|  |  | ||||||
|     property int tabmargins: 15 |     property int tabmargins: 15 | ||||||
|  |  | ||||||
|   | |||||||
| @@ -36,6 +36,8 @@ ApplicationWindow{ | |||||||
|     property bool fullscreen: shadersettings.fullscreen |     property bool fullscreen: shadersettings.fullscreen | ||||||
|     onFullscreenChanged: visibility = (fullscreen ? Window.FullScreen : Window.Windowed) |     onFullscreenChanged: visibility = (fullscreen ? Window.FullScreen : Window.Windowed) | ||||||
|  |  | ||||||
|  |     flags: Qt.WA_TranslucentBackground | ||||||
|  |     color: "#00000000" | ||||||
|     title: qsTr("cool-old-term") |     title: qsTr("cool-old-term") | ||||||
|  |  | ||||||
|     Action { |     Action { | ||||||
| @@ -128,6 +130,7 @@ ApplicationWindow{ | |||||||
|         scale: 1.0 / shadersettings.window_scaling |         scale: 1.0 / shadersettings.window_scaling | ||||||
|         smooth: false |         smooth: false | ||||||
|         antialiasing: false |         antialiasing: false | ||||||
|  |         opacity: shadersettings.windowOpacity * 0.3 + 0.7 | ||||||
|  |  | ||||||
|         Loader{ |         Loader{ | ||||||
|             id: frame |             id: frame | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user