Improve terminal frame and expose frame size setting.
This commit is contained in:
		@@ -99,7 +99,12 @@ QtObject {
 | 
				
			|||||||
    property real rbgShift: 0.0
 | 
					    property real rbgShift: 0.0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    property real _margin: 0.5
 | 
					    property real _margin: 0.5
 | 
				
			||||||
 | 
					    property real _frameMargin: 0.5
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    property real margin: Utils.lint(1.0, 20.0, _margin)
 | 
					    property real margin: Utils.lint(1.0, 20.0, _margin)
 | 
				
			||||||
 | 
					    property real frameMargin: Utils.lint(1.0, 50.0, _frameMargin)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    property real totalMargin: frameMargin + margin
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    readonly property int no_rasterization: 0
 | 
					    readonly property int no_rasterization: 0
 | 
				
			||||||
    readonly property int scanline_rasterization: 1
 | 
					    readonly property int scanline_rasterization: 1
 | 
				
			||||||
@@ -238,8 +243,7 @@ QtObject {
 | 
				
			|||||||
            "burnInQuality": burnInQuality,
 | 
					            "burnInQuality": burnInQuality,
 | 
				
			||||||
            "useCustomCommand": useCustomCommand,
 | 
					            "useCustomCommand": useCustomCommand,
 | 
				
			||||||
            "customCommand": customCommand,
 | 
					            "customCommand": customCommand,
 | 
				
			||||||
            "useFastBurnIn": useFastBurnIn,
 | 
					            "useFastBurnIn": useFastBurnIn
 | 
				
			||||||
            "blinkingCursor": blinkingCursor
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        return stringify(settings)
 | 
					        return stringify(settings)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -266,7 +270,9 @@ QtObject {
 | 
				
			|||||||
            "windowOpacity": windowOpacity,
 | 
					            "windowOpacity": windowOpacity,
 | 
				
			||||||
            "fontName": fontNames[rasterization],
 | 
					            "fontName": fontNames[rasterization],
 | 
				
			||||||
            "fontWidth": fontWidth,
 | 
					            "fontWidth": fontWidth,
 | 
				
			||||||
            "margin": _margin
 | 
					            "margin": _margin,
 | 
				
			||||||
 | 
					            "blinkingCursor": blinkingCursor,
 | 
				
			||||||
 | 
					            "frameMargin": _frameMargin,
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        return settings
 | 
					        return settings
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -335,9 +341,6 @@ QtObject {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        useFastBurnIn = settings.useFastBurnIn
 | 
					        useFastBurnIn = settings.useFastBurnIn
 | 
				
			||||||
                !== undefined ? settings.useFastBurnIn : useFastBurnIn
 | 
					                !== undefined ? settings.useFastBurnIn : useFastBurnIn
 | 
				
			||||||
 | 
					 | 
				
			||||||
        blinkingCursor = settings.blinkingCursor
 | 
					 | 
				
			||||||
                !== undefined ? settings.blinkingCursor : blinkingCursor
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    function loadProfileString(profileString) {
 | 
					    function loadProfileString(profileString) {
 | 
				
			||||||
@@ -379,6 +382,9 @@ QtObject {
 | 
				
			|||||||
        fontWidth = settings.fontWidth !== undefined ? settings.fontWidth : fontWidth
 | 
					        fontWidth = settings.fontWidth !== undefined ? settings.fontWidth : fontWidth
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        _margin = settings.margin !== undefined ? settings.margin : _margin
 | 
					        _margin = settings.margin !== undefined ? settings.margin : _margin
 | 
				
			||||||
 | 
					        _frameMargin = settings.frameMargin !== undefined ? settings.frameMargin : _frameMargin
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        blinkingCursor = settings.blinkingCursor !== undefined ? settings.blinkingCursor : blinkingCursor
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        handleFontChanged()
 | 
					        handleFontChanged()
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -459,7 +465,9 @@ QtObject {
 | 
				
			|||||||
                "screenCurvature": 0.3,
 | 
					                "screenCurvature": 0.3,
 | 
				
			||||||
                "staticNoise": 0.1198,
 | 
					                "staticNoise": 0.1198,
 | 
				
			||||||
                "windowOpacity": 1,
 | 
					                "windowOpacity": 1,
 | 
				
			||||||
                "margin": 0.5
 | 
					                "margin": 0.5,
 | 
				
			||||||
 | 
					                "blinkingCursor": false,
 | 
				
			||||||
 | 
					                "frameMargin": 0.1
 | 
				
			||||||
            }'
 | 
					            }'
 | 
				
			||||||
            builtin: true
 | 
					            builtin: true
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@@ -486,7 +494,9 @@ QtObject {
 | 
				
			|||||||
                "screenCurvature": 0.3,
 | 
					                "screenCurvature": 0.3,
 | 
				
			||||||
                "staticNoise": 0.1198,
 | 
					                "staticNoise": 0.1198,
 | 
				
			||||||
                "windowOpacity": 1,
 | 
					                "windowOpacity": 1,
 | 
				
			||||||
                "margin": 0.5
 | 
					                "margin": 0.5,
 | 
				
			||||||
 | 
					                "blinkingCursor": false,
 | 
				
			||||||
 | 
					                "frameMargin": 0.1
 | 
				
			||||||
            }'
 | 
					            }'
 | 
				
			||||||
            builtin: true
 | 
					            builtin: true
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@@ -513,7 +523,9 @@ QtObject {
 | 
				
			|||||||
                "screenCurvature": 0.3,
 | 
					                "screenCurvature": 0.3,
 | 
				
			||||||
                "staticNoise": 0.15,
 | 
					                "staticNoise": 0.15,
 | 
				
			||||||
                "windowOpacity": 1,
 | 
					                "windowOpacity": 1,
 | 
				
			||||||
                "margin": 0.5
 | 
					                "margin": 0.5,
 | 
				
			||||||
 | 
					                "blinkingCursor": false,
 | 
				
			||||||
 | 
					                "frameMargin": 0.1
 | 
				
			||||||
            }'
 | 
					            }'
 | 
				
			||||||
            builtin: true
 | 
					            builtin: true
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@@ -540,7 +552,9 @@ QtObject {
 | 
				
			|||||||
                "screenCurvature": 0,
 | 
					                "screenCurvature": 0,
 | 
				
			||||||
                "staticNoise": 0.15,
 | 
					                "staticNoise": 0.15,
 | 
				
			||||||
                "windowOpacity": 1,
 | 
					                "windowOpacity": 1,
 | 
				
			||||||
                "margin": 0.5
 | 
					                "margin": 0.5,
 | 
				
			||||||
 | 
					                "blinkingCursor": false,
 | 
				
			||||||
 | 
					                "frameMargin": 0.1
 | 
				
			||||||
            }'
 | 
					            }'
 | 
				
			||||||
            builtin: true
 | 
					            builtin: true
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@@ -567,7 +581,9 @@ QtObject {
 | 
				
			|||||||
                "screenCurvature": 0.5,
 | 
					                "screenCurvature": 0.5,
 | 
				
			||||||
                "staticNoise": 0.099,
 | 
					                "staticNoise": 0.099,
 | 
				
			||||||
                "windowOpacity": 1,
 | 
					                "windowOpacity": 1,
 | 
				
			||||||
                "margin": 0.5
 | 
					                "margin": 0.5,
 | 
				
			||||||
 | 
					                "blinkingCursor": false,
 | 
				
			||||||
 | 
					                "frameMargin": 0.2
 | 
				
			||||||
            }'
 | 
					            }'
 | 
				
			||||||
            builtin: true
 | 
					            builtin: true
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@@ -594,7 +610,9 @@ QtObject {
 | 
				
			|||||||
                "screenCurvature": 0.5,
 | 
					                "screenCurvature": 0.5,
 | 
				
			||||||
                "staticNoise": 0.2969,
 | 
					                "staticNoise": 0.2969,
 | 
				
			||||||
                "windowOpacity": 1,
 | 
					                "windowOpacity": 1,
 | 
				
			||||||
                "margin": 0.5
 | 
					                "margin": 0.5,
 | 
				
			||||||
 | 
					                "blinkingCursor": false,
 | 
				
			||||||
 | 
					                "frameMargin": 0.5
 | 
				
			||||||
            }'
 | 
					            }'
 | 
				
			||||||
            builtin: true
 | 
					            builtin: true
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@@ -621,7 +639,9 @@ QtObject {
 | 
				
			|||||||
                "screenCurvature": 0.4,
 | 
					                "screenCurvature": 0.4,
 | 
				
			||||||
                "staticNoise": 0.0503,
 | 
					                "staticNoise": 0.0503,
 | 
				
			||||||
                "windowOpacity": 1,
 | 
					                "windowOpacity": 1,
 | 
				
			||||||
                "margin": 0.5
 | 
					                "margin": 0.5,
 | 
				
			||||||
 | 
					                "blinkingCursor": false,
 | 
				
			||||||
 | 
					                "frameMargin": 0.2
 | 
				
			||||||
            }'
 | 
					            }'
 | 
				
			||||||
            builtin: true
 | 
					            builtin: true
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@@ -648,7 +668,9 @@ QtObject {
 | 
				
			|||||||
                "screenCurvature": 0.2,
 | 
					                "screenCurvature": 0.2,
 | 
				
			||||||
                "staticNoise": 0,
 | 
					                "staticNoise": 0,
 | 
				
			||||||
                "windowOpacity": 1,
 | 
					                "windowOpacity": 1,
 | 
				
			||||||
                "margin": 0.5
 | 
					                "margin": 0.5,
 | 
				
			||||||
 | 
					                "blinkingCursor": false,
 | 
				
			||||||
 | 
					                "frameMargin": 0.1
 | 
				
			||||||
            }'
 | 
					            }'
 | 
				
			||||||
            builtin: true
 | 
					            builtin: true
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@@ -675,7 +697,9 @@ QtObject {
 | 
				
			|||||||
                "screenCurvature": 0,
 | 
					                "screenCurvature": 0,
 | 
				
			||||||
                "staticNoise": 0.0955,
 | 
					                "staticNoise": 0.0955,
 | 
				
			||||||
                "windowOpacity": 0.7,
 | 
					                "windowOpacity": 0.7,
 | 
				
			||||||
                "margin": 0.1
 | 
					                "margin": 0.1,
 | 
				
			||||||
 | 
					                "blinkingCursor": false,
 | 
				
			||||||
 | 
					                "frameMargin": 0
 | 
				
			||||||
            }'
 | 
					            }'
 | 
				
			||||||
            builtin: true
 | 
					            builtin: true
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -73,7 +73,7 @@ Item{
 | 
				
			|||||||
        id: kterminal
 | 
					        id: kterminal
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        property int textureResolutionScale: appSettings.lowResolutionFont ? devicePixelRatio : 1
 | 
					        property int textureResolutionScale: appSettings.lowResolutionFont ? devicePixelRatio : 1
 | 
				
			||||||
        property int margin: appSettings.margin / screenScaling
 | 
					        property int margin: appSettings.totalMargin / screenScaling
 | 
				
			||||||
        property int totalWidth: Math.floor(parent.width / (screenScaling * fontWidth))
 | 
					        property int totalWidth: Math.floor(parent.width / (screenScaling * fontWidth))
 | 
				
			||||||
        property int totalHeight: Math.floor(parent.height / screenScaling)
 | 
					        property int totalHeight: Math.floor(parent.height / screenScaling)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -178,7 +178,7 @@ Item{
 | 
				
			|||||||
    property alias contextmenu: menuLoader.item
 | 
					    property alias contextmenu: menuLoader.item
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    MouseArea {
 | 
					    MouseArea {
 | 
				
			||||||
        property real margin: appSettings.margin
 | 
					        property real margin: appSettings.totalMargin
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        acceptedButtons: Qt.LeftButton | Qt.MiddleButton | Qt.RightButton
 | 
					        acceptedButtons: Qt.LeftButton | Qt.MiddleButton | Qt.RightButton
 | 
				
			||||||
        anchors.fill: parent
 | 
					        anchors.fill: parent
 | 
				
			||||||
@@ -219,8 +219,8 @@ Item{
 | 
				
			|||||||
            var cc = Qt.size(0.5 - x, 0.5 - y);
 | 
					            var cc = Qt.size(0.5 - x, 0.5 - y);
 | 
				
			||||||
            var distortion = (cc.height * cc.height + cc.width * cc.width) * appSettings.screenCurvature * appSettings.screenCurvatureSize;
 | 
					            var distortion = (cc.height * cc.height + cc.width * cc.width) * appSettings.screenCurvature * appSettings.screenCurvatureSize;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            return Qt.point((x - cc.width  * (1+distortion) * distortion) * kterminal.totalWidth,
 | 
					            return Qt.point((x - cc.width  * (1+distortion) * distortion) * (kterminal.totalWidth),
 | 
				
			||||||
                           (y - cc.height * (1+distortion) * distortion) * kterminal.totalHeight)
 | 
					                           (y - cc.height * (1+distortion) * distortion) * (kterminal.totalHeight))
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    ShaderEffectSource{
 | 
					    ShaderEffectSource{
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -206,6 +206,13 @@ ColumnLayout {
 | 
				
			|||||||
                onValueChanged: appSettings._margin = value
 | 
					                onValueChanged: appSettings._margin = value
 | 
				
			||||||
                value: appSettings._margin
 | 
					                value: appSettings._margin
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					            Label {
 | 
				
			||||||
 | 
					                text: qsTr("Frame size")
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            SimpleSlider {
 | 
				
			||||||
 | 
					                onValueChanged: appSettings._frameMargin = value
 | 
				
			||||||
 | 
					                value: appSettings._frameMargin
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
            Label {
 | 
					            Label {
 | 
				
			||||||
                text: qsTr("Opacity")
 | 
					                text: qsTr("Opacity")
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -79,8 +79,8 @@ Item {
 | 
				
			|||||||
         property size jitterDisplacement: Qt.size(0.007 * jitter, 0.002 * jitter)
 | 
					         property size jitterDisplacement: Qt.size(0.007 * jitter, 0.002 * jitter)
 | 
				
			||||||
         property real shadowLength: 0.25 * screenCurvature * Utils.lint(0.50, 1.5, ambientLight)
 | 
					         property real shadowLength: 0.25 * screenCurvature * Utils.lint(0.50, 1.5, ambientLight)
 | 
				
			||||||
         property real staticNoise: appSettings.staticNoise
 | 
					         property real staticNoise: appSettings.staticNoise
 | 
				
			||||||
         property size scaleNoiseSize: Qt.size((width) / (noiseTexture.width * appSettings.windowScaling * appSettings.totalFontScaling),
 | 
					         property size scaleNoiseSize: Qt.size((width * 0.75) / (noiseTexture.width * appSettings.windowScaling * appSettings.totalFontScaling),
 | 
				
			||||||
                                               (height) / (noiseTexture.height * appSettings.windowScaling * appSettings.totalFontScaling))
 | 
					                                               (height * 0.75) / (noiseTexture.height * appSettings.windowScaling * appSettings.totalFontScaling))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
         property size virtualResolution: parent.virtualResolution
 | 
					         property size virtualResolution: parent.virtualResolution
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -88,6 +88,8 @@ Item {
 | 
				
			|||||||
         // We progressively disable rasterization from 4x up to 2x resolution.
 | 
					         // We progressively disable rasterization from 4x up to 2x resolution.
 | 
				
			||||||
         property real rasterizationIntensity: Utils.smoothstep(2.0, 4.0, _screenDensity)
 | 
					         property real rasterizationIntensity: Utils.smoothstep(2.0, 4.0, _screenDensity)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					         property real displayTerminalFrame: appSettings._frameMargin > 0 || appSettings.screenCurvature > 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
         property real time: timeManager.time
 | 
					         property real time: timeManager.time
 | 
				
			||||||
         property ShaderEffectSource noiseSource: noiseShaderSource
 | 
					         property ShaderEffectSource noiseSource: noiseShaderSource
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -190,9 +192,10 @@ Item {
 | 
				
			|||||||
             (((staticNoise !== 0 || jitter !== 0) ||(fallBack && (flickering || horizontalSync))) ? "
 | 
					             (((staticNoise !== 0 || jitter !== 0) ||(fallBack && (flickering || horizontalSync))) ? "
 | 
				
			||||||
                 uniform lowp sampler2D noiseSource;
 | 
					                 uniform lowp sampler2D noiseSource;
 | 
				
			||||||
                 uniform highp vec2 scaleNoiseSize;" : "") +
 | 
					                 uniform highp vec2 scaleNoiseSize;" : "") +
 | 
				
			||||||
             (screenCurvature !== 0 ? "
 | 
					             (displayTerminalFrame ? "
 | 
				
			||||||
                 uniform highp float screenCurvature;
 | 
					 | 
				
			||||||
                 uniform lowp sampler2D frameSource;" : "") +
 | 
					                 uniform lowp sampler2D frameSource;" : "") +
 | 
				
			||||||
 | 
					             (screenCurvature !== 0 ? "
 | 
				
			||||||
 | 
					                 uniform highp float screenCurvature;" : "") +
 | 
				
			||||||
             (glowingLine !== 0 ? "
 | 
					             (glowingLine !== 0 ? "
 | 
				
			||||||
                 uniform highp float glowingLine;" : "") +
 | 
					                 uniform highp float glowingLine;" : "") +
 | 
				
			||||||
             (chromaColor !== 0 ? "
 | 
					             (chromaColor !== 0 ? "
 | 
				
			||||||
@@ -328,7 +331,7 @@ Item {
 | 
				
			|||||||
                 (ambientLight !== 0 ? "
 | 
					                 (ambientLight !== 0 ? "
 | 
				
			||||||
                     finalColor += vec3(ambientLight) * (1.0 - distance) * (1.0 - distance);" : "") +
 | 
					                     finalColor += vec3(ambientLight) * (1.0 - distance) * (1.0 - distance);" : "") +
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                 (screenCurvature !== 0 ?
 | 
					                 (displayTerminalFrame ?
 | 
				
			||||||
                    "vec4 frameColor = texture2D(frameSource, qt_TexCoord0);
 | 
					                    "vec4 frameColor = texture2D(frameSource, qt_TexCoord0);
 | 
				
			||||||
                     finalColor = mix(finalColor, frameColor.rgb, frameColor.a);"
 | 
					                     finalColor = mix(finalColor, frameColor.rgb, frameColor.a);"
 | 
				
			||||||
                 : "") +
 | 
					                 : "") +
 | 
				
			||||||
@@ -351,7 +354,7 @@ Item {
 | 
				
			|||||||
     Loader {
 | 
					     Loader {
 | 
				
			||||||
         id: terminalFrameLoader
 | 
					         id: terminalFrameLoader
 | 
				
			||||||
 | 
					
 | 
				
			||||||
         active: screenCurvature !== 0
 | 
					         active: dynamicShader.displayTerminalFrame
 | 
				
			||||||
 | 
					
 | 
				
			||||||
         width: staticShader.width
 | 
					         width: staticShader.width
 | 
				
			||||||
         height: staticShader.height
 | 
					         height: staticShader.height
 | 
				
			||||||
@@ -363,7 +366,7 @@ Item {
 | 
				
			|||||||
             visible: false
 | 
					             visible: false
 | 
				
			||||||
             format: ShaderEffectSource.RGBA
 | 
					             format: ShaderEffectSource.RGBA
 | 
				
			||||||
 | 
					
 | 
				
			||||||
             NewTerminalFrame {
 | 
					             TerminalFrame {
 | 
				
			||||||
                 id: terminalFrame
 | 
					                 id: terminalFrame
 | 
				
			||||||
                 blending: false
 | 
					                 blending: false
 | 
				
			||||||
                 anchors.fill: parent
 | 
					                 anchors.fill: parent
 | 
				
			||||||
@@ -441,18 +444,9 @@ Item {
 | 
				
			|||||||
             (ambientLight !== 0 ? "
 | 
					             (ambientLight !== 0 ? "
 | 
				
			||||||
                 uniform lowp float ambientLight;" : "") +
 | 
					                 uniform lowp float ambientLight;" : "") +
 | 
				
			||||||
 | 
					
 | 
				
			||||||
             "
 | 
					             shaderLibrary.min2 +
 | 
				
			||||||
             float min2(vec2 v) {
 | 
					             shaderLibrary.sum2 +
 | 
				
			||||||
                 return min(v.x, v.y);
 | 
					             shaderLibrary.rgb2grey +
 | 
				
			||||||
             }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
             float sum2(vec2 v) {
 | 
					 | 
				
			||||||
                 return v.x + v.y;
 | 
					 | 
				
			||||||
             }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
             float rgb2grey(vec3 v){
 | 
					 | 
				
			||||||
                 return dot(v, vec3(0.21, 0.72, 0.04));
 | 
					 | 
				
			||||||
             }" +
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
             "vec3 convertWithChroma(vec3 inColor) {
 | 
					             "vec3 convertWithChroma(vec3 inColor) {
 | 
				
			||||||
                vec3 outColor = inColor;" +
 | 
					                vec3 outColor = inColor;" +
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -22,7 +22,7 @@ import QtQuick 2.0
 | 
				
			|||||||
import "utils.js" as Utils
 | 
					import "utils.js" as Utils
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ShaderEffect {
 | 
					ShaderEffect {
 | 
				
			||||||
    property color _staticFrameColor: "#ffffff"
 | 
					    property color _staticFrameColor: "#fff"
 | 
				
			||||||
    property color _backgroundColor: appSettings.backgroundColor
 | 
					    property color _backgroundColor: appSettings.backgroundColor
 | 
				
			||||||
    property color _fontColor: appSettings.fontColor
 | 
					    property color _fontColor: appSettings.fontColor
 | 
				
			||||||
    property color _lightColor: Utils.mix(_fontColor, _backgroundColor, 0.2)
 | 
					    property color _lightColor: Utils.mix(_fontColor, _backgroundColor, 0.2)
 | 
				
			||||||
@@ -30,9 +30,15 @@ ShaderEffect {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    property color frameColor: Utils.mix(_staticFrameColor, _lightColor, _ambientLight)
 | 
					    property color frameColor: Utils.mix(_staticFrameColor, _lightColor, _ambientLight)
 | 
				
			||||||
    property real screenCurvature: appSettings.screenCurvature * appSettings.screenCurvatureSize
 | 
					    property real screenCurvature: appSettings.screenCurvature * appSettings.screenCurvatureSize
 | 
				
			||||||
    property real shadowLength: 0.5 * screenCurvature * Utils.lint(0.50, 1.5, _ambientLight)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    property size aadelta: Qt.size(1.0 / width, 1.0 / height)
 | 
					    // Coefficient of the log curve used to approximate shadowing
 | 
				
			||||||
 | 
					    property real screenShadowCoeff: Utils.lint(20.0, 10.0, _ambientLight)
 | 
				
			||||||
 | 
					    property real frameShadowCoeff: Utils.lint(20.0, 10.0, _ambientLight)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    property size margin: Qt.size(
 | 
				
			||||||
 | 
					        appSettings.frameMargin / width * appSettings.windowScaling,
 | 
				
			||||||
 | 
					        appSettings.frameMargin / height * appSettings.windowScaling
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ShaderLibrary {
 | 
					    ShaderLibrary {
 | 
				
			||||||
        id: shaderLibrary
 | 
					        id: shaderLibrary
 | 
				
			||||||
@@ -44,10 +50,11 @@ ShaderEffect {
 | 
				
			|||||||
        #endif
 | 
					        #endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        uniform lowp float screenCurvature;
 | 
					        uniform lowp float screenCurvature;
 | 
				
			||||||
        uniform lowp float shadowLength;
 | 
					        uniform lowp float screenShadowCoeff;
 | 
				
			||||||
 | 
					        uniform lowp float frameShadowCoeff;
 | 
				
			||||||
        uniform highp float qt_Opacity;
 | 
					        uniform highp float qt_Opacity;
 | 
				
			||||||
        uniform lowp vec4 frameColor;
 | 
					        uniform lowp vec4 frameColor;
 | 
				
			||||||
        uniform mediump vec2 aadelta;
 | 
					        uniform mediump vec2 margin;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        varying highp vec2 qt_TexCoord0;
 | 
					        varying highp vec2 qt_TexCoord0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -65,25 +72,29 @@ ShaderEffect {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        "
 | 
					        "
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        vec2 positiveLog(vec2 x) {
 | 
				
			||||||
 | 
					            return clamp(log(x), vec2(0.0), vec2(100.0));
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        void main() {
 | 
					        void main() {
 | 
				
			||||||
            vec2 staticCoords = qt_TexCoord0;
 | 
					            vec2 staticCoords = qt_TexCoord0;
 | 
				
			||||||
            vec2 coords = distortCoordinates(staticCoords);
 | 
					            vec2 coords = distortCoordinates(staticCoords) * (vec2(1.0) + margin * 2.0) - margin;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            vec3 color = vec3(0.0);
 | 
					            vec2 vignetteCoords = staticCoords * (1.0 - staticCoords.yx);
 | 
				
			||||||
 | 
					            float vignette = pow(prod2(vignetteCoords) * 15.0, 0.25);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            vec3 color = frameColor.rgb * vec3(1.0 - vignette);
 | 
				
			||||||
            float alpha = 0.0;
 | 
					            float alpha = 0.0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            float outShadowLength = shadowLength;
 | 
					            float frameShadow = max2(positiveLog(-coords * frameShadowCoeff + vec2(1.0)) + positiveLog(coords * frameShadowCoeff - (vec2(frameShadowCoeff) - vec2(1.0))));
 | 
				
			||||||
            float inShadowLength = shadowLength * 0.5;
 | 
					            frameShadow = max(sqrt(frameShadow), 0.0);
 | 
				
			||||||
 | 
					            color *= frameShadow;
 | 
				
			||||||
 | 
					            alpha = sum2(1.0 - step(vec2(0.0), coords) + step(vec2(1.0), coords));
 | 
				
			||||||
 | 
					            alpha = clamp(alpha, 0.0, 1.0);
 | 
				
			||||||
 | 
					            alpha *= mix(1.0, 0.9, frameShadow);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            float outShadow = max2(1.0 - smoothstep(vec2(-outShadowLength), vec2(0.0), coords) + smoothstep(vec2(1.0), vec2(1.0 + outShadowLength), coords));
 | 
					            float screenShadow = 1.0 - prod2(positiveLog(coords * screenShadowCoeff + vec2(1.0)) * positiveLog(-coords * screenShadowCoeff + vec2(screenShadowCoeff + 1.0)));
 | 
				
			||||||
            outShadow = clamp(sqrt(outShadow), 0.0, 1.0);
 | 
					            alpha = max(0.8 * screenShadow, alpha);
 | 
				
			||||||
            color += frameColor.rgb * outShadow;
 | 
					 | 
				
			||||||
            alpha = sum2(1.0 - smoothstep(vec2(0.0), aadelta, coords) + smoothstep(vec2(1.0) - aadelta, vec2(1.0), coords));
 | 
					 | 
				
			||||||
            alpha = clamp(alpha, 0.0, 1.0) * mix(1.0, 0.9, outShadow);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            float inShadow = 1.0 - prod2(smoothstep(0.0, inShadowLength, coords) - smoothstep(1.0 - inShadowLength, 1.0, coords));
 | 
					 | 
				
			||||||
            inShadow = 0.5 * inShadow * inShadow;
 | 
					 | 
				
			||||||
            alpha = max(alpha, inShadow);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            gl_FragColor = vec4(color * alpha, alpha);
 | 
					            gl_FragColor = vec4(color * alpha, alpha);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@@ -40,7 +40,7 @@
 | 
				
			|||||||
        <file>fonts/1977-commodore-pet/PetMe.ttf</file>
 | 
					        <file>fonts/1977-commodore-pet/PetMe.ttf</file>
 | 
				
			||||||
        <file>BurnInEffect.qml</file>
 | 
					        <file>BurnInEffect.qml</file>
 | 
				
			||||||
        <file>fonts/modern-terminus/TerminusTTF-4.46.0.ttf</file>
 | 
					        <file>fonts/modern-terminus/TerminusTTF-4.46.0.ttf</file>
 | 
				
			||||||
        <file>NewTerminalFrame.qml</file>
 | 
					        <file>TerminalFrame.qml</file>
 | 
				
			||||||
        <file>SlowBurnIn.qml</file>
 | 
					        <file>SlowBurnIn.qml</file>
 | 
				
			||||||
        <file>menus/WindowMenu.qml</file>
 | 
					        <file>menus/WindowMenu.qml</file>
 | 
				
			||||||
        <file>menus/FullContextMenu.qml</file>
 | 
					        <file>menus/FullContextMenu.qml</file>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user