8 Commits

Author SHA1 Message Date
Marius P
52527b8b55 project file allow installation in another dir than "/usr"
E.g. this way I can build and install in "~/.local", or "/usr/local".
2024-10-11 10:57:26 +02:00
e3c2e024bb Merge pull request 'Hide visible scrolling in background staticNoise' (#768) from aaronkollasch/random-static-noise into master
Reviewed-on: #768
2024-10-11 10:57:00 +02:00
Aaron Kollasch
b69610d7f3 Hide visible scrolling in static noise
Randomize vertical position of staticNoise texel and add to
existing scrolling of noise texture (both horizontal and vertical;
faster in vertical direction)
2024-10-11 10:56:16 +02:00
92a768d6f1 Merge pull request 'Terminal frame color customization and optional glossiness' (#760) from forestbeasts/bettergloss into master
Reviewed-on: #760
2024-10-11 10:53:47 +02:00
Frost
5ecd7d754d Add frame color/gloss to the default profiles 2024-10-11 10:52:41 +02:00
Frost
e3161f64f6 Add frame gloss setting
Lets you turn off the bright reflections.
2024-10-11 10:52:41 +02:00
Frost
5b0b091ab6 Add frame color setting
It's saved in the profile, and defaults to white.
2024-10-11 10:52:41 +02:00
Frost
4fdf28fb79 Add reflections to frame for better glossiness
I mean, it's how it works in the real world; it's added to the frame's base color, not occluded by the frame.
2024-10-11 10:52:41 +02:00
6 changed files with 82 additions and 10 deletions

View File

@@ -19,20 +19,26 @@ RESOURCES += qml/resources.qrc
## INSTALLS ## INSTALLS
######################################### #########################################
target.path += /usr/bin/ PREFIX = $$(PREFIX) # Pass the make install PREFIX via environment variable. E.g. "PREFIX=/path/to/my/dir qmake".
isEmpty(PREFIX) {
message(No prefix given. Using /usr.)
PREFIX=/usr
}
target.path = $$PREFIX/bin
INSTALLS += target INSTALLS += target
# Install icons # Install icons
unix { unix {
icon32.files = icons/32x32/cool-retro-term.png icon32.files = icons/32x32/cool-retro-term.png
icon32.path = /usr/share/icons/hicolor/32x32/apps icon32.path = $$PREFIX/share/icons/hicolor/32x32/apps
icon64.files = icons/64x64/cool-retro-term.png icon64.files = icons/64x64/cool-retro-term.png
icon64.path = /usr/share/icons/hicolor/64x64/apps icon64.path = $$PREFIX/share/icons/hicolor/64x64/apps
icon128.files = icons/128x128/cool-retro-term.png icon128.files = icons/128x128/cool-retro-term.png
icon128.path = /usr/share/icons/hicolor/128x128/apps icon128.path = $$PREFIX/share/icons/hicolor/128x128/apps
icon256.files = icons/256x256/cool-retro-term.png icon256.files = icons/256x256/cool-retro-term.png
icon256.path = /usr/share/icons/hicolor/256x256/apps icon256.path = $$PREFIX/share/icons/hicolor/256x256/apps
INSTALLS += icon32 icon64 icon128 icon256 INSTALLS += icon32 icon64 icon128 icon256
} }

View File

@@ -71,6 +71,7 @@ QtObject {
property string _backgroundColor: "#000000" property string _backgroundColor: "#000000"
property string _fontColor: "#ff8100" property string _fontColor: "#ff8100"
property string _frameColor: "#ffffff"
property string saturatedColor: Utils.mix(Utils.strToColor("#FFFFFF"), property string saturatedColor: Utils.mix(Utils.strToColor("#FFFFFF"),
Utils.strToColor(_fontColor), Utils.strToColor(_fontColor),
saturationColor * 0.5) saturationColor * 0.5)
@@ -81,6 +82,7 @@ QtObject {
_backgroundColor), _backgroundColor),
Utils.strToColor(saturatedColor), Utils.strToColor(saturatedColor),
0.7 + (contrast * 0.3)) 0.7 + (contrast * 0.3))
property color frameColor: Utils.strToColor(_frameColor)
property real staticNoise: 0.12 property real staticNoise: 0.12
property real screenCurvature: 0.3 property real screenCurvature: 0.3
@@ -90,6 +92,7 @@ QtObject {
property real chromaColor: 0.25 property real chromaColor: 0.25
property real saturationColor: 0.25 property real saturationColor: 0.25
property real frameGloss: 0
property real jitter: 0.2 property real jitter: 0.2
@@ -251,11 +254,13 @@ QtObject {
var settings = { var settings = {
"backgroundColor": _backgroundColor, "backgroundColor": _backgroundColor,
"fontColor": _fontColor, "fontColor": _fontColor,
"frameColor": _frameColor,
"flickering": flickering, "flickering": flickering,
"horizontalSync": horizontalSync, "horizontalSync": horizontalSync,
"staticNoise": staticNoise, "staticNoise": staticNoise,
"chromaColor": chromaColor, "chromaColor": chromaColor,
"saturationColor": saturationColor, "saturationColor": saturationColor,
"frameGloss": frameGloss,
"screenCurvature": screenCurvature, "screenCurvature": screenCurvature,
"glowingLine": glowingLine, "glowingLine": glowingLine,
"burnIn": burnIn, "burnIn": burnIn,
@@ -345,6 +350,7 @@ QtObject {
_backgroundColor = settings.backgroundColor _backgroundColor = settings.backgroundColor
!== undefined ? settings.backgroundColor : _backgroundColor !== undefined ? settings.backgroundColor : _backgroundColor
_fontColor = settings.fontColor !== undefined ? settings.fontColor : _fontColor _fontColor = settings.fontColor !== undefined ? settings.fontColor : _fontColor
_frameColor = settings.frameColor !== undefined ? settings.frameColor : _frameColor
horizontalSync = settings.horizontalSync horizontalSync = settings.horizontalSync
!== undefined ? settings.horizontalSync : horizontalSync !== undefined ? settings.horizontalSync : horizontalSync
@@ -353,6 +359,7 @@ QtObject {
chromaColor = settings.chromaColor !== undefined ? settings.chromaColor : chromaColor chromaColor = settings.chromaColor !== undefined ? settings.chromaColor : chromaColor
saturationColor = settings.saturationColor saturationColor = settings.saturationColor
!== undefined ? settings.saturationColor : saturationColor !== undefined ? settings.saturationColor : saturationColor
frameGloss = settings.frameGloss !== undefined ? settings.frameGloss : frameGloss
screenCurvature = settings.screenCurvature screenCurvature = settings.screenCurvature
!== undefined ? settings.screenCurvature : screenCurvature !== undefined ? settings.screenCurvature : screenCurvature
glowingLine = settings.glowingLine !== undefined ? settings.glowingLine : glowingLine glowingLine = settings.glowingLine !== undefined ? settings.glowingLine : glowingLine
@@ -459,6 +466,8 @@ QtObject {
"rbgShift": 0, "rbgShift": 0,
"saturationColor": 0.2483, "saturationColor": 0.2483,
"screenCurvature": 0.3, "screenCurvature": 0.3,
"frameColor": "#ffffff",
"frameGloss": 0,
"staticNoise": 0.1198, "staticNoise": 0.1198,
"windowOpacity": 1, "windowOpacity": 1,
"margin": 0.5, "margin": 0.5,
@@ -488,6 +497,8 @@ QtObject {
"rbgShift": 0, "rbgShift": 0,
"saturationColor": 0.0, "saturationColor": 0.0,
"screenCurvature": 0.3, "screenCurvature": 0.3,
"frameColor": "#ffffff",
"frameGloss": 0,
"staticNoise": 0.1198, "staticNoise": 0.1198,
"windowOpacity": 1, "windowOpacity": 1,
"margin": 0.5, "margin": 0.5,
@@ -517,6 +528,8 @@ QtObject {
"rbgShift": 0, "rbgShift": 0,
"saturationColor": 0.5, "saturationColor": 0.5,
"screenCurvature": 0.3, "screenCurvature": 0.3,
"frameColor": "#ffffff",
"frameGloss": 0,
"staticNoise": 0.15, "staticNoise": 0.15,
"windowOpacity": 1, "windowOpacity": 1,
"margin": 0.5, "margin": 0.5,
@@ -546,6 +559,8 @@ QtObject {
"rbgShift": 0, "rbgShift": 0,
"saturationColor": 0, "saturationColor": 0,
"screenCurvature": 0, "screenCurvature": 0,
"frameColor": "#ffffff",
"frameGloss": 0,
"staticNoise": 0.15, "staticNoise": 0.15,
"windowOpacity": 1, "windowOpacity": 1,
"margin": 0.5, "margin": 0.5,
@@ -575,6 +590,8 @@ QtObject {
"rbgShift": 0, "rbgShift": 0,
"saturationColor": 0, "saturationColor": 0,
"screenCurvature": 0.5, "screenCurvature": 0.5,
"frameColor": "#ffffff",
"frameGloss": 0,
"staticNoise": 0.099, "staticNoise": 0.099,
"windowOpacity": 1, "windowOpacity": 1,
"margin": 0.5, "margin": 0.5,
@@ -604,6 +621,8 @@ QtObject {
"rbgShift": 0.2969, "rbgShift": 0.2969,
"saturationColor": 0, "saturationColor": 0,
"screenCurvature": 0.5, "screenCurvature": 0.5,
"frameColor": "#ffffff",
"frameGloss": 0,
"staticNoise": 0.2969, "staticNoise": 0.2969,
"windowOpacity": 1, "windowOpacity": 1,
"margin": 0.5, "margin": 0.5,
@@ -633,6 +652,8 @@ QtObject {
"rbgShift": 0.3524, "rbgShift": 0.3524,
"saturationColor": 0, "saturationColor": 0,
"screenCurvature": 0.4, "screenCurvature": 0.4,
"frameColor": "#ffffff",
"frameGloss": 0,
"staticNoise": 0.0503, "staticNoise": 0.0503,
"windowOpacity": 1, "windowOpacity": 1,
"margin": 0.5, "margin": 0.5,
@@ -662,6 +683,8 @@ QtObject {
"rbgShift": 0, "rbgShift": 0,
"saturationColor": 0, "saturationColor": 0,
"screenCurvature": 0.2, "screenCurvature": 0.2,
"frameColor": "#ffffff",
"frameGloss": 0,
"staticNoise": 0, "staticNoise": 0,
"windowOpacity": 1, "windowOpacity": 1,
"margin": 0.5, "margin": 0.5,
@@ -691,6 +714,8 @@ QtObject {
"rbgShift": 0, "rbgShift": 0,
"saturationColor": 0.4983, "saturationColor": 0.4983,
"screenCurvature": 0, "screenCurvature": 0,
"frameColor": "#ffffff",
"frameGloss": 0,
"staticNoise": 0.0955, "staticNoise": 0.0955,
"windowOpacity": 0.7, "windowOpacity": 0.7,
"margin": 0.1, "margin": 0.1,

View File

@@ -149,6 +149,11 @@ ColumnLayout {
value: appSettings.saturationColor value: appSettings.saturationColor
enabled: appSettings.chromaColor !== 0 enabled: appSettings.chromaColor !== 0
} }
CheckableSlider {
name: qsTr("Frame Gloss")
onNewValue: appSettings.frameGloss = newValue
value: appSettings.frameGloss
}
} }
RowLayout { RowLayout {
Layout.fillWidth: true Layout.fillWidth: true
@@ -166,6 +171,13 @@ ColumnLayout {
onColorSelected: appSettings._backgroundColor = color onColorSelected: appSettings._backgroundColor = color
color: appSettings._backgroundColor color: appSettings._backgroundColor
} }
ColorButton {
name: qsTr("Frame")
height: 50
Layout.fillWidth: true
onColorSelected: appSettings._frameColor = color
color: appSettings._frameColor
}
} }
} }
} }

View File

@@ -37,6 +37,8 @@ Item {
property real ambientLight: appSettings.ambientLight * 0.2 property real ambientLight: appSettings.ambientLight * 0.2
property real frameGloss: appSettings.frameGloss
property size virtualResolution property size virtualResolution
property size screenResolution property size screenResolution
@@ -59,6 +61,7 @@ Item {
property real screenCurvature: parent.screenCurvature property real screenCurvature: parent.screenCurvature
property real chromaColor: parent.chromaColor property real chromaColor: parent.chromaColor
property real ambientLight: parent.ambientLight property real ambientLight: parent.ambientLight
property real frameGloss: parent.frameGloss
property real flickering: appSettings.flickering property real flickering: appSettings.flickering
property real horizontalSync: appSettings.horizontalSync property real horizontalSync: appSettings.horizontalSync
@@ -172,6 +175,7 @@ Item {
uniform highp vec4 fontColor; uniform highp vec4 fontColor;
uniform highp vec4 backgroundColor; uniform highp vec4 backgroundColor;
uniform lowp float shadowLength; uniform lowp float shadowLength;
uniform lowp float frameGloss;
uniform highp vec2 virtualResolution; uniform highp vec2 virtualResolution;
uniform lowp float rasterizationIntensity;\n" + uniform lowp float rasterizationIntensity;\n" +
@@ -243,6 +247,17 @@ Item {
" return outColor; " return outColor;
}" + }" +
//pseudo-random vector
//https://stackoverflow.com/a/10625698
"float random( vec2 p )
{
vec2 K1 = vec2(
23.14069263277926, // e^pi (Gelfond's constant)
2.665144142690225 // 2^sqrt(2) (Gelfond-Schneider constant)
);
return fract( cos( dot(p,K1) ) * 12345.6789 );
}" +
"void main() {" + "void main() {" +
"vec2 cc = vec2(0.5) - qt_TexCoord0;" + "vec2 cc = vec2(0.5) - qt_TexCoord0;" +
"float distance = length(cc);" + "float distance = length(cc);" +
@@ -281,7 +296,11 @@ Item {
: "") + : "") +
(jitter !== 0 || staticNoise !== 0 ? (jitter !== 0 || staticNoise !== 0 ?
"vec4 noiseTexel = texture2D(noiseSource, scaleNoiseSize * coords + vec2(fract(time / 51.0), fract(time / 237.0)));" "vec4 noiseTexel = texture2D(
noiseSource, scaleNoiseSize * coords
+ vec2(0.0, random(vec2(fract(time / 237.0), 822.9582)))
+ vec2(fract(time / 31.0), fract(time / 177.0))
);"
: "") + : "") +
(jitter !== 0 ? " (jitter !== 0 ? "
@@ -321,7 +340,7 @@ Item {
(displayTerminalFrame ? (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 + (finalColor*frameGloss), frameColor.a);"
: "") + : "") +
"gl_FragColor = vec4(finalColor, qt_Opacity);" + "gl_FragColor = vec4(finalColor, qt_Opacity);" +

View File

@@ -22,13 +22,13 @@ import QtQuick 2.0
import "utils.js" as Utils import "utils.js" as Utils
ShaderEffect { ShaderEffect {
property color _staticFrameColor: "#fff" property color _frameColor: appSettings.frameColor
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)
property real _ambientLight: Utils.lint(0.2, 0.8, appSettings.ambientLight) property real _ambientLight: Utils.lint(0.2, 0.8, appSettings.ambientLight)
property color frameColor: Utils.mix(_staticFrameColor, _lightColor, _ambientLight) property color frameColor: Utils.mix(_frameColor, _lightColor, _ambientLight)
property real screenCurvature: appSettings.screenCurvature * appSettings.screenCurvatureSize property real screenCurvature: appSettings.screenCurvature * appSettings.screenCurvatureSize
// Coefficient of the log curve used to approximate shadowing // Coefficient of the log curve used to approximate shadowing

View File

@@ -5,7 +5,17 @@ CONFIG += ordered
SUBDIRS += qmltermwidget SUBDIRS += qmltermwidget
SUBDIRS += app SUBDIRS += app
#########################################
## INSTALLS
#########################################
PREFIX = $$(PREFIX) # Pass the make install PREFIX via environment variable. E.g. "PREFIX=/path/to/my/dir qmake".
isEmpty(PREFIX) {
message(No prefix given. Using /usr.)
PREFIX=/usr
}
desktop.files += cool-retro-term.desktop desktop.files += cool-retro-term.desktop
desktop.path += /usr/share/applications desktop.path += $$PREFIX/share/applications
INSTALLS += desktop INSTALLS += desktop