Merge daf85dfe7eb9303c423a458f833d59800c9cba60 into f157648d1e51878a10e02a8836c1e15aa8c59cc9

This commit is contained in:
Roman Pekarsky 2025-08-18 15:53:17 +00:00 committed by GitHub
commit fdbd99d172
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 66 additions and 15 deletions

View File

@ -100,6 +100,8 @@ QtObject {
property real _margin: 0.5
property real _frameMargin: 0.5
property bool showFrame: false
property string frameColor: "#ffffff"
property real margin: Utils.lint(1.0, 20.0, _margin)
property real frameMargin: Utils.lint(1.0, 50.0, _frameMargin)
@ -272,6 +274,8 @@ QtObject {
"margin": _margin,
"blinkingCursor": blinkingCursor,
"frameMargin": _frameMargin,
"showFrame": showFrame,
"frameColor": frameColor,
}
return settings
}
@ -379,6 +383,8 @@ QtObject {
_margin = settings.margin !== undefined ? settings.margin : _margin
_frameMargin = settings.frameMargin !== undefined ? settings.frameMargin : _frameMargin
showFrame = settings.showFrame !== undefined ? settings.showFrame : showFrame
frameColor = settings.frameColor !== undefined ? settings.frameColor : frameColor
blinkingCursor = settings.blinkingCursor !== undefined ? settings.blinkingCursor : blinkingCursor
@ -463,7 +469,10 @@ QtObject {
"windowOpacity": 1,
"margin": 0.5,
"blinkingCursor": false,
"frameMargin": 0.1
"frameMargin": 0.1,
"showFrame": true,
"frameColor": "#ffffff",
"showReflections": true
}'
builtin: true
}
@ -492,7 +501,10 @@ QtObject {
"windowOpacity": 1,
"margin": 0.5,
"blinkingCursor": false,
"frameMargin": 0.1
"frameMargin": 0.1,
"showFrame": true,
"frameColor": "#ffffff",
"showReflections": true
}'
builtin: true
}
@ -521,7 +533,10 @@ QtObject {
"windowOpacity": 1,
"margin": 0.5,
"blinkingCursor": false,
"frameMargin": 0.1
"frameMargin": 0.1,
"showFrame": true,
"frameColor": "#ffffff",
"showReflections": true
}'
builtin: true
}
@ -550,7 +565,10 @@ QtObject {
"windowOpacity": 1,
"margin": 0.5,
"blinkingCursor": false,
"frameMargin": 0.1
"frameMargin": 0.1,
"showFrame": true,
"frameColor": "#ffffff",
"showReflections": true
}'
builtin: true
}
@ -579,7 +597,10 @@ QtObject {
"windowOpacity": 1,
"margin": 0.5,
"blinkingCursor": false,
"frameMargin": 0.2
"frameMargin": 0.2,
"showFrame": true,
"frameColor": "#ffffff",
"showReflections": true
}'
builtin: true
}
@ -608,7 +629,10 @@ QtObject {
"windowOpacity": 1,
"margin": 0.5,
"blinkingCursor": false,
"frameMargin": 0.5
"frameMargin": 0.5,
"showFrame": true,
"frameColor": "#ffffff",
"showReflections": true
}'
builtin: true
}
@ -637,7 +661,10 @@ QtObject {
"windowOpacity": 1,
"margin": 0.5,
"blinkingCursor": false,
"frameMargin": 0.2
"frameMargin": 0.2,
"showFrame": true,
"frameColor": "#ffffff",
"showReflections": true
}'
builtin: true
}
@ -666,7 +693,10 @@ QtObject {
"windowOpacity": 1,
"margin": 0.5,
"blinkingCursor": false,
"frameMargin": 0.1
"frameMargin": 0.1,
"showFrame": true,
"frameColor": "#ffffff",
"showReflections": true
}'
builtin: true
}
@ -695,7 +725,10 @@ QtObject {
"windowOpacity": 0.7,
"margin": 0.1,
"blinkingCursor": false,
"frameMargin": 0
"frameMargin": 0,
"showFrame": true,
"frameColor": "#ffffff",
"showReflections": true
}'
builtin: true
}

View File

@ -223,6 +223,12 @@ ColumnLayout {
value: appSettings.windowOpacity
visible: !appSettings.isMacOS
}
CheckBox {
text: qsTr("Show frame")
checked: appSettings.showFrame
onCheckedChanged: appSettings.showFrame = checked
Layout.columnSpan: 2
}
}
}

View File

@ -166,6 +166,13 @@ ColumnLayout {
onColorSelected: appSettings._backgroundColor = color
color: appSettings._backgroundColor
}
ColorButton {
name: qsTr("Frame")
height: 50
Layout.fillWidth: true
onColorSelected: appSettings.frameColor = color
color: appSettings.frameColor
}
}
}
}

View File

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

View File

@ -83,7 +83,7 @@ Item {
// We progressively disable rasterization from 4x up to 2x resolution.
property real rasterizationIntensity: Utils.smoothstep(2.0, 4.0, _screenDensity)
property real displayTerminalFrame: appSettings._frameMargin > 0 || appSettings.screenCurvature > 0
property real displayTerminalFrame: appSettings.showFrame
property real time: timeManager.time
property ShaderEffectSource noiseSource: noiseShaderSource
@ -385,6 +385,8 @@ Item {
property real rbgShift: (appSettings.rbgShift / width) * appSettings.totalFontScaling // TODO FILIPPO width here is wrong.
property bool showReflections: appSettings.showFrame
property int rasterization: appSettings.rasterization
property real screen_brightness: Utils.lint(0.5, 1.5, appSettings.brightness)
@ -454,8 +456,11 @@ Item {
(screenCurvature !== 0 ? "
float distortion = dot(cc, cc) * screenCurvature;
vec2 curvatureCoords = (qt_TexCoord0 - cc * (1.0 + distortion) * distortion);
vec2 curvatureCoords = (qt_TexCoord0 - cc * (1.0 + distortion) * distortion);" +
(showReflections ? "
vec2 txt_coords = - 2.0 * curvatureCoords + 3.0 * step(vec2(0.0), curvatureCoords) * curvatureCoords - 3.0 * step(vec2(1.0), curvatureCoords) * curvatureCoords;"
: "
vec2 txt_coords = clamp(curvatureCoords, vec2(0.0), vec2(1.0));")
:"
vec2 txt_coords = qt_TexCoord0;") +
@ -473,7 +478,7 @@ Item {
"txt_color += vec3(0.0001);" +
"float greyscale_color = rgb2grey(txt_color);" +
(screenCurvature !== 0 ? "
(screenCurvature !== 0 && showReflections ? "
float reflectionMask = sum2(step(vec2(0.0), curvatureCoords) - step(vec2(1.0), curvatureCoords));
reflectionMask = clamp(reflectionMask, 0.0, 1.0);"
:

View File

@ -22,7 +22,7 @@ import QtQuick 2.0
import "utils.js" as Utils
ShaderEffect {
property color _staticFrameColor: "#fff"
property color _staticFrameColor: Utils.strToColor(appSettings.frameColor)
property color _backgroundColor: appSettings.backgroundColor
property color _fontColor: appSettings.fontColor
property color _lightColor: Utils.mix(_fontColor, _backgroundColor, 0.2)