Compare commits

..

25 Commits

Author SHA1 Message Date
b98408dd32 Merge pull request 'Revert "Make the burn-in look more like the real thing."' (#862) from revert-burnin into master
Reviewed-on: #862
2024-10-15 08:30:14 +02:00
36054434a5 Revert "Make the burn-in look more like the real thing."
This reverts commit 27ca6b3f73fffce73931b3c6912f6a8aaddb50bc.
2024-10-15 08:29:09 +02:00
d9e41c27ef Merge pull request 'Add intellij to the gitignore' (#861) from update-gitignore into master
Reviewed-on: #861
2024-10-14 18:28:42 +02:00
8e8f8e4706 Add intellij to the gitignore 2024-10-14 18:28:23 +02:00
edb1a6f9e1 Merge pull request 'Shift+Insert -> paste selection' (#702) from agreppin/kb-shift-insert into master
Reviewed-on: #702
2024-10-11 11:08:02 +02:00
Alain Greppin
33723db314 Shift+Insert -> paste selection 2024-10-11 11:06:35 +02:00
4bc440e906 Merge pull request 'Document the --version option' (#706) from njhanley/document-version-option into master
Reviewed-on: #706
2024-10-11 11:03:07 +02:00
Nick Hanley
27b248d851 Document the --version option 2024-10-11 11:02:46 +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
49213a1cf0 Merge pull request 'Fix visual bug on nvidia' (#859) from nvidia-patch into master
Reviewed-on: #859
2024-10-11 10:52:27 +02:00
e30db231f6 Fix visual bug on nvidia
https://gitlab.archlinux.org/archlinux/packaging/packages/cool-retro-term/-/blob/main/0001-nvidia-fix.patch?ref_type=heads
2024-10-11 10:52:01 +02:00
6609c4867f Merge pull request 'Use new line char instead of flushing the output' (#792) from mystuffs/master into master
Reviewed-on: #792
2024-10-11 10:49:37 +02:00
rilysh
84c5e8bca6 use newline char instead flushing 2024-10-11 10:49:14 +02:00
1a25749315 Merge pull request 'Fix typo in app.pro' (#801) from eltociear/patch-1 into master
Reviewed-on: #801
2024-10-11 10:48:48 +02:00
Ikko Eltociear Ashimine
3852f5995d Fix typo in app.pro
INTALLS -> INSTALLS
2024-10-11 10:48:22 +02:00
9093b7a16e Merge pull request 'typo: IBM Dos to IBM DOS' (#858) from rename-ibm-dos into master
Reviewed-on: #858
2024-10-11 10:47:57 +02:00
afead1c2c0 typo: IBM Dos to IBM DOS 2024-10-11 10:47:06 +02:00
1b2572f381 Merge pull request 'Make the burn-in look more like a real terminal.' (#845) from j3pic/more-accurate-burn-in into master
Reviewed-on: #845
2024-10-11 10:44:39 +02:00
Jeremy Phelps
27ca6b3f73 Make the burn-in look more like the real thing.
Exponential decay instead of linear.
2024-06-14 04:26:52 -04:00
10 changed files with 90 additions and 22 deletions

3
.gitignore vendored
View File

@ -48,3 +48,6 @@ cool-retro-term
.DS_Store
*.app
# IntelliJ
.idea

View File

@ -16,7 +16,7 @@ macx:ICON = icons/crt.icns
RESOURCES += qml/resources.qrc
#########################################
## INTALLS
## INSTALLS
#########################################
target.path += /usr/bin/

View File

@ -49,15 +49,16 @@ int main(int argc, char *argv[])
if (argc>1 && (!strcmp(argv[1],"-h") || !strcmp(argv[1],"--help"))) {
QTextStream cout(stdout, QIODevice::WriteOnly);
cout << "Usage: " << argv[0] << " [--default-settings] [--workdir <dir>] [--program <prog>] [-p|--profile <prof>] [--fullscreen] [-h|--help]" << endl;
cout << " --default-settings Run cool-retro-term with the default settings" << endl;
cout << " --workdir <dir> Change working directory to 'dir'" << endl;
cout << " -e <cmd> Command to execute. This option will catch all following arguments, so use it as the last option." << endl;
cout << " -T <title> Set window title to 'title'." << endl;
cout << " --fullscreen Run cool-retro-term in fullscreen." << endl;
cout << " -p|--profile <prof> Run cool-retro-term with the given profile." << endl;
cout << " -h|--help Print this help." << endl;
cout << " --verbose Print additional information such as profiles and settings." << endl;
cout << "Usage: " << argv[0] << " [--default-settings] [--workdir <dir>] [--program <prog>] [-p|--profile <prof>] [--fullscreen] [-h|--help]" << '\n';
cout << " --default-settings Run cool-retro-term with the default settings" << '\n';
cout << " --workdir <dir> Change working directory to 'dir'" << '\n';
cout << " -e <cmd> Command to execute. This option will catch all following arguments, so use it as the last option." << '\n';
cout << " -T <title> Set window title to 'title'." << '\n';
cout << " --fullscreen Run cool-retro-term in fullscreen." << '\n';
cout << " -p|--profile <prof> Run cool-retro-term with the given profile." << '\n';
cout << " -h|--help Print this help." << '\n';
cout << " --verbose Print additional information such as profiles and settings." << '\n';
cout << " -v|--version Print the program name and version." << '\n';
return 0;
}
@ -65,7 +66,7 @@ int main(int argc, char *argv[])
if (argc>1 && (!strcmp(argv[1],"-v") || !strcmp(argv[1],"--version"))) {
QTextStream cout(stdout, QIODevice::WriteOnly);
cout << "cool-retro-term " << appVersion << endl;
cout << "cool-retro-term " << appVersion << '\n';
return 0;
}

View File

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

View File

@ -82,15 +82,11 @@ Window {
nameSelected(name)
close()
}
namefield.forceActiveFocus()
}
}
Button {
text: qsTr("Cancel")
onClicked: function() {
namefield.forceActiveFocus()
close()
}
onClicked: close()
}
}
}

View File

@ -58,6 +58,13 @@ Item{
kterminal.pasteClipboard()
}
}
Connections {
target: pasteActionAlt
onTriggered: {
kterminal.pasteSelection()
}
}
//When settings are updated sources need to be redrawn.
Connections {

View File

@ -149,6 +149,11 @@ ColumnLayout {
value: appSettings.saturationColor
enabled: appSettings.chromaColor !== 0
}
CheckableSlider {
name: qsTr("Frame Gloss")
onNewValue: appSettings.frameGloss = newValue
value: appSettings.frameGloss
}
}
RowLayout {
Layout.fillWidth: true
@ -166,6 +171,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

@ -37,6 +37,8 @@ Item {
property real ambientLight: appSettings.ambientLight * 0.2
property real frameGloss: appSettings.frameGloss
property size virtualResolution
property size screenResolution
@ -59,6 +61,7 @@ Item {
property real screenCurvature: parent.screenCurvature
property real chromaColor: parent.chromaColor
property real ambientLight: parent.ambientLight
property real frameGloss: parent.frameGloss
property real flickering: appSettings.flickering
property real horizontalSync: appSettings.horizontalSync
@ -172,6 +175,7 @@ Item {
uniform highp vec4 fontColor;
uniform highp vec4 backgroundColor;
uniform lowp float shadowLength;
uniform lowp float frameGloss;
uniform highp vec2 virtualResolution;
uniform lowp float rasterizationIntensity;\n" +
@ -243,6 +247,17 @@ Item {
" 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() {" +
"vec2 cc = vec2(0.5) - qt_TexCoord0;" +
"float distance = length(cc);" +
@ -281,7 +296,11 @@ Item {
: "") +
(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 ? "
@ -321,7 +340,7 @@ Item {
(displayTerminalFrame ?
"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);" +

View File

@ -22,13 +22,13 @@ import QtQuick 2.0
import "utils.js" as Utils
ShaderEffect {
property color _staticFrameColor: "#fff"
property color _frameColor: appSettings.frameColor
property color _backgroundColor: appSettings.backgroundColor
property color _fontColor: appSettings.fontColor
property color _lightColor: Utils.mix(_fontColor, _backgroundColor, 0.2)
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
// Coefficient of the log curve used to approximate shadowing
@ -87,7 +87,7 @@ ShaderEffect {
float alpha = 0.0;
float frameShadow = max2(positiveLog(-coords * frameShadowCoeff + vec2(1.0)) + positiveLog(coords * frameShadowCoeff - (vec2(frameShadowCoeff) - vec2(1.0))));
frameShadow = max(sqrt(frameShadow), 0.0);
frameShadow = clamp(sqrt(frameShadow), 0.0, 1.0);
color *= frameShadow;
alpha = sum2(1.0 - step(vec2(0.0), coords) + step(vec2(1.0), coords));
alpha = clamp(alpha, 0.0, 1.0);

View File

@ -116,6 +116,11 @@ ApplicationWindow {
text: qsTr("Paste")
shortcut: "Ctrl+Shift+V"
}
Action {
id: pasteActionAlt
text: qsTr("Paste selection")
shortcut: "Shift+Insert"
}
Action {
id: zoomIn
text: qsTr("Zoom In")