Skip to content

Commit 9fd2e95

Browse files
committed
merged Swordfish90#760: Terminal frame color customization and optional glossiness
1 parent 8ee082f commit 9fd2e95

File tree

4 files changed

+46
-5
lines changed

4 files changed

+46
-5
lines changed

app/qml/ApplicationSettings.qml

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ QtObject {
3232
readonly property real maximumFontScaling: 2.50
3333

3434
readonly property real minBurnInFadeTime: 160
35-
readonly property real maxBurnInFadeTime: 160000
35+
readonly property real maxBurnInFadeTime: 1600
3636

3737
property bool isMacOS: Qt.platform.os === "osx"
3838

@@ -71,6 +71,7 @@ QtObject {
7171

7272
property string _backgroundColor: "#000000"
7373
property string _fontColor: "#ff8100"
74+
property string _frameColor: "#ffffff"
7475
property string saturatedColor: Utils.mix(Utils.strToColor("#FFFFFF"),
7576
Utils.strToColor(_fontColor),
7677
saturationColor * 0.5)
@@ -81,6 +82,7 @@ QtObject {
8182
_backgroundColor),
8283
Utils.strToColor(saturatedColor),
8384
0.7 + (contrast * 0.3))
85+
property color frameColor: Utils.strToColor(_frameColor)
8486

8587
property real staticNoise: 0.12
8688
property real screenCurvature: 0.3
@@ -90,6 +92,7 @@ QtObject {
9092

9193
property real chromaColor: 0.25
9294
property real saturationColor: 0.25
95+
property real frameGloss: 0
9396

9497
property real jitter: 0.2
9598

@@ -251,11 +254,13 @@ QtObject {
251254
var settings = {
252255
"backgroundColor": _backgroundColor,
253256
"fontColor": _fontColor,
257+
"frameColor": _frameColor,
254258
"flickering": flickering,
255259
"horizontalSync": horizontalSync,
256260
"staticNoise": staticNoise,
257261
"chromaColor": chromaColor,
258262
"saturationColor": saturationColor,
263+
"frameGloss": frameGloss,
259264
"screenCurvature": screenCurvature,
260265
"glowingLine": glowingLine,
261266
"burnIn": burnIn,
@@ -345,6 +350,7 @@ QtObject {
345350
_backgroundColor = settings.backgroundColor
346351
!== undefined ? settings.backgroundColor : _backgroundColor
347352
_fontColor = settings.fontColor !== undefined ? settings.fontColor : _fontColor
353+
_frameColor = settings.frameColor !== undefined ? settings.frameColor : _frameColor
348354

349355
horizontalSync = settings.horizontalSync
350356
!== undefined ? settings.horizontalSync : horizontalSync
@@ -353,6 +359,7 @@ QtObject {
353359
chromaColor = settings.chromaColor !== undefined ? settings.chromaColor : chromaColor
354360
saturationColor = settings.saturationColor
355361
!== undefined ? settings.saturationColor : saturationColor
362+
frameGloss = settings.frameGloss !== undefined ? settings.frameGloss : frameGloss
356363
screenCurvature = settings.screenCurvature
357364
!== undefined ? settings.screenCurvature : screenCurvature
358365
glowingLine = settings.glowingLine !== undefined ? settings.glowingLine : glowingLine
@@ -459,6 +466,8 @@ QtObject {
459466
"rbgShift": 0,
460467
"saturationColor": 0.2483,
461468
"screenCurvature": 0.3,
469+
"frameColor": "#ffffff",
470+
"frameGloss": 0,
462471
"staticNoise": 0.1198,
463472
"windowOpacity": 1,
464473
"margin": 0.5,
@@ -488,6 +497,8 @@ QtObject {
488497
"rbgShift": 0,
489498
"saturationColor": 0.0,
490499
"screenCurvature": 0.3,
500+
"frameColor": "#ffffff",
501+
"frameGloss": 0,
491502
"staticNoise": 0.1198,
492503
"windowOpacity": 1,
493504
"margin": 0.5,
@@ -517,6 +528,8 @@ QtObject {
517528
"rbgShift": 0,
518529
"saturationColor": 0.5,
519530
"screenCurvature": 0.3,
531+
"frameColor": "#ffffff",
532+
"frameGloss": 0,
520533
"staticNoise": 0.15,
521534
"windowOpacity": 1,
522535
"margin": 0.5,
@@ -546,6 +559,8 @@ QtObject {
546559
"rbgShift": 0,
547560
"saturationColor": 0,
548561
"screenCurvature": 0,
562+
"frameColor": "#ffffff",
563+
"frameGloss": 0,
549564
"staticNoise": 0.15,
550565
"windowOpacity": 1,
551566
"margin": 0.5,
@@ -575,6 +590,8 @@ QtObject {
575590
"rbgShift": 0,
576591
"saturationColor": 0,
577592
"screenCurvature": 0.5,
593+
"frameColor": "#ffffff",
594+
"frameGloss": 0,
578595
"staticNoise": 0.099,
579596
"windowOpacity": 1,
580597
"margin": 0.5,
@@ -604,6 +621,8 @@ QtObject {
604621
"rbgShift": 0.2969,
605622
"saturationColor": 0,
606623
"screenCurvature": 0.5,
624+
"frameColor": "#ffffff",
625+
"frameGloss": 0,
607626
"staticNoise": 0.2969,
608627
"windowOpacity": 1,
609628
"margin": 0.5,
@@ -613,7 +632,7 @@ QtObject {
613632
builtin: true
614633
}
615634
ListElement {
616-
text: "IBM DOS"
635+
text: "IBM Dos"
617636
obj_string: '{
618637
"ambientLight": 0.151,
619638
"backgroundColor": "#000000",
@@ -633,6 +652,8 @@ QtObject {
633652
"rbgShift": 0.3524,
634653
"saturationColor": 0,
635654
"screenCurvature": 0.4,
655+
"frameColor": "#ffffff",
656+
"frameGloss": 0,
636657
"staticNoise": 0.0503,
637658
"windowOpacity": 1,
638659
"margin": 0.5,
@@ -662,6 +683,8 @@ QtObject {
662683
"rbgShift": 0,
663684
"saturationColor": 0,
664685
"screenCurvature": 0.2,
686+
"frameColor": "#ffffff",
687+
"frameGloss": 0,
665688
"staticNoise": 0,
666689
"windowOpacity": 1,
667690
"margin": 0.5,
@@ -691,6 +714,8 @@ QtObject {
691714
"rbgShift": 0,
692715
"saturationColor": 0.4983,
693716
"screenCurvature": 0,
717+
"frameColor": "#ffffff",
718+
"frameGloss": 0,
694719
"staticNoise": 0.0955,
695720
"windowOpacity": 0.7,
696721
"margin": 0.1,

app/qml/SettingsTerminalTab.qml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,11 @@ ColumnLayout {
149149
value: appSettings.saturationColor
150150
enabled: appSettings.chromaColor !== 0
151151
}
152+
CheckableSlider {
153+
name: qsTr("Frame Gloss")
154+
onNewValue: appSettings.frameGloss = newValue
155+
value: appSettings.frameGloss
156+
}
152157
}
153158
RowLayout {
154159
Layout.fillWidth: true
@@ -166,6 +171,13 @@ ColumnLayout {
166171
onColorSelected: appSettings._backgroundColor = color
167172
color: appSettings._backgroundColor
168173
}
174+
ColorButton {
175+
name: qsTr("Frame")
176+
height: 50
177+
Layout.fillWidth: true
178+
onColorSelected: appSettings._frameColor = color
179+
color: appSettings._frameColor
180+
}
169181
}
170182
}
171183
}

app/qml/ShaderTerminal.qml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ Item {
3737

3838
property real ambientLight: appSettings.ambientLight * 0.2
3939

40+
property real frameGloss: appSettings.frameGloss
41+
4042
property size virtualResolution
4143
property size screenResolution
4244

@@ -59,6 +61,7 @@ Item {
5961
property real screenCurvature: parent.screenCurvature
6062
property real chromaColor: parent.chromaColor
6163
property real ambientLight: parent.ambientLight
64+
property real frameGloss: parent.frameGloss
6265

6366
property real flickering: appSettings.flickering
6467
property real horizontalSync: appSettings.horizontalSync
@@ -172,6 +175,7 @@ Item {
172175
uniform highp vec4 fontColor;
173176
uniform highp vec4 backgroundColor;
174177
uniform lowp float shadowLength;
178+
uniform lowp float frameGloss;
175179
176180
uniform highp vec2 virtualResolution;
177181
uniform lowp float rasterizationIntensity;\n" +
@@ -336,7 +340,7 @@ Item {
336340

337341
(displayTerminalFrame ?
338342
"vec4 frameColor = texture2D(frameSource, qt_TexCoord0);
339-
finalColor = mix(finalColor, frameColor.rgb, frameColor.a);"
343+
finalColor = mix(finalColor, frameColor.rgb + (finalColor*frameGloss), frameColor.a);"
340344
: "") +
341345

342346
"gl_FragColor = vec4(finalColor, qt_Opacity);" +

app/qml/TerminalFrame.qml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ import QtQuick 2.0
2222
import "utils.js" as Utils
2323

2424
ShaderEffect {
25-
property color _staticFrameColor: "#fff"
25+
property color _frameColor: appSettings.frameColor
2626
property color _backgroundColor: appSettings.backgroundColor
2727
property color _fontColor: appSettings.fontColor
2828
property color _lightColor: Utils.mix(_fontColor, _backgroundColor, 0.2)
2929
property real _ambientLight: Utils.lint(0.2, 0.8, appSettings.ambientLight)
3030

31-
property color frameColor: Utils.mix(_staticFrameColor, _lightColor, _ambientLight)
31+
property color frameColor: Utils.mix(_frameColor, _lightColor, _ambientLight)
3232
property real screenCurvature: appSettings.screenCurvature * appSettings.screenCurvatureSize
3333

3434
// Coefficient of the log curve used to approximate shadowing

0 commit comments

Comments
 (0)