1
0
mirror of https://github.com/Swordfish90/cool-retro-term.git synced 2025-01-18 12:15:27 +00:00

Finally we can set opacity! Yuuuuu.

This commit is contained in:
Filippo Scognamiglio 2014-07-14 02:23:22 +02:00
parent b9de57aec1
commit 239a1e0a30
5 changed files with 19 additions and 9 deletions

View File

@ -28,6 +28,7 @@ Item{
property bool fullscreen: false
property real windowOpacity: 1.0
property real ambient_light: 0.2
property real contrast: 0.85
property real brightness: 0.5
@ -160,7 +161,8 @@ Item{
ambient_light: ambient_light,
fontScalingIndexes: fontScalingIndexes,
fontIndexes: fontIndexes,
frameReflections: _frameReflections
frameReflections: _frameReflections,
windowOpacity: windowOpacity
}
return JSON.stringify(settings);
}
@ -225,6 +227,7 @@ Item{
fontScalingIndexes = settings.fontScalingIndexes !== undefined ? settings.fontScalingIndexes : fontScalingIndexes
_frameReflections = settings.frameReflections !== undefined ? settings.frameReflections : _frameReflections;
windowOpacity = settings.windowOpacity !== undefined ? settings.windowOpacity : windowOpacity;
}
function loadProfileString(profileString){

View File

@ -197,7 +197,7 @@ Item{
id: blurredSource
sourceItem: blurredterminal
recursive: true
live: true
live: false
smooth: false
antialiasing: false
@ -205,13 +205,11 @@ Item{
Timer{
id: livetimer
running: true
onTriggered: parent.live = false;
onRunningChanged: running ?
timeManager.onTimeChanged.connect(blurredSource.scheduleUpdate) :
timeManager.onTimeChanged.disconnect(blurredSource.scheduleUpdate)
function updateImageHandler(){
livetimer.restart();
blurredSource.live = true;
}
Component.onCompleted: kterminal.updatedImage.connect(updateImageHandler);
Component.onCompleted: kterminal.updatedImage.connect(restart);
}
}
ShaderEffectSource{
@ -219,6 +217,7 @@ Item{
sourceItem: blurredterminal
sourceRect: frame.sourceRect
format: ShaderEffectSource.Alpha
hideSource: true
}
ShaderEffect {
id: blurredterminal

View File

@ -89,6 +89,11 @@ Tab{
onValueChanged: shadersettings.ambient_light = value;
value: shadersettings.ambient_light
}
Text{ text: qsTr("Opacity") }
SimpleSlider{
onValueChanged: shadersettings.windowOpacity = value
value: shadersettings.windowOpacity
}
}
}
GroupBox{

View File

@ -28,7 +28,7 @@ Window {
id: settings_window
title: qsTr("Settings")
width: 640
height: 420
height: 450
property int tabmargins: 15

View File

@ -36,6 +36,8 @@ ApplicationWindow{
property bool fullscreen: shadersettings.fullscreen
onFullscreenChanged: visibility = (fullscreen ? Window.FullScreen : Window.Windowed)
flags: Qt.WA_TranslucentBackground
color: "#00000000"
title: qsTr("cool-old-term")
Action {
@ -128,6 +130,7 @@ ApplicationWindow{
scale: 1.0 / shadersettings.window_scaling
smooth: false
antialiasing: false
opacity: shadersettings.windowOpacity * 0.3 + 0.7
Loader{
id: frame