From 976e713a2b154245c0d758bd7ad9524fe3747019 Mon Sep 17 00:00:00 2001 From: Simon Schneegans Date: Sat, 1 Jan 2022 20:12:41 +0100 Subject: [PATCH 1/2] :tada: Make TV Effect color configurable --- prefs.js | 1 + resources/ui/gtk3.ui | 75 +++++++++++++++++++ resources/ui/gtk4.ui | 67 +++++++++++++++++ ...ell.extensions.burn-my-windows.gschema.xml | 7 ++ src/extension/TVEffectShader.js | 7 +- 5 files changed, 156 insertions(+), 1 deletion(-) diff --git a/prefs.js b/prefs.js index 20961b0..562b30c 100644 --- a/prefs.js +++ b/prefs.js @@ -57,6 +57,7 @@ var PreferencesDialog = class PreferencesDialog { this._bindAdjustment('matrix-randomness'); this._bindColorButton('matrix-trail-color'); this._bindColorButton('matrix-tip-color'); + this._bindColorButton('tv-effect-color'); // The fire-gradient-reset button needs to by bound explicitly. this._builder.get_object('reset-fire-colors').connect('clicked', () => { diff --git a/resources/ui/gtk3.ui b/resources/ui/gtk3.ui index 305f21b..bfd9940 100644 --- a/resources/ui/gtk3.ui +++ b/resources/ui/gtk3.ui @@ -459,6 +459,81 @@ + + + + 30 + 10 + + + TV Effect Options + 0 + 1 + + + + + + + + + + + none + 1 + + + + + 10 + 10 + 10 + 10 + 0 + + + 8 + + + Color + 0 + start + center + 1 + + + + + 1 + 1 + + + + + + edit-clear-symbolic + 1 + + Reset to Default Value + + + + + + + + + + + + + diff --git a/resources/ui/gtk4.ui b/resources/ui/gtk4.ui index ee3165b..dbcc828 100644 --- a/resources/ui/gtk4.ui +++ b/resources/ui/gtk4.ui @@ -574,6 +574,73 @@ + + + 30 + 10 + + + TV Effect Options + 0 + 1 + + + + + + + + + + + none + 1 + + + + + 0 + + + + + Color + 0 + start + center + 1 + + + + + 0 + 1 + + + + + edit-clear-symbolic + Reset to Default Value + + + + + + + + + + + + + + diff --git a/schemas/org.gnome.shell.extensions.burn-my-windows.gschema.xml b/schemas/org.gnome.shell.extensions.burn-my-windows.gschema.xml index 8de7d19..ec84354 100644 --- a/schemas/org.gnome.shell.extensions.burn-my-windows.gschema.xml +++ b/schemas/org.gnome.shell.extensions.burn-my-windows.gschema.xml @@ -95,6 +95,13 @@ The color matrix trails. + + "rgb(255, 255, 255)" + TV Effect Color + The color of the TV effect. + + + \ No newline at end of file diff --git a/src/extension/TVEffectShader.js b/src/extension/TVEffectShader.js index e27f82a..f60db07 100644 --- a/src/extension/TVEffectShader.js +++ b/src/extension/TVEffectShader.js @@ -30,6 +30,9 @@ var TVEffectShader = GObject.registerClass( _init(settings) { super._init({shader_type: Clutter.ShaderType.FRAGMENT_SHADER}); + const color = + Clutter.Color.from_string(settings.get_string('tv-effect-color'))[1]; + this.set_shader_source(` // Inject some common shader snippets. @@ -68,7 +71,9 @@ var TVEffectShader = GObject.registerClass( float mask = tbMask * lrMask * ffMask; vec4 windowColor = texture2D(uTexture, cogl_tex_coord_in[0].st); - vec4 effectColor = vec4(1, 1, 1, 1) * windowColor.a; + vec4 effectColor = vec4(${color.red / 255}, + ${color.green / 255}, + ${color.blue / 255}, 1.0) * windowColor.a; windowColor.rgb = mix(windowColor.rgb, effectColor.rgb, smoothstep(0, 1, uProgress)); From 8c6c1bc7bd1957c2110d76679c0c4f5188f7ee28 Mon Sep 17 00:00:00 2001 From: Simon Schneegans Date: Sat, 1 Jan 2022 20:16:59 +0100 Subject: [PATCH 2/2] :beetle: Fix GTK3 --- resources/ui/gtk3.ui | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/resources/ui/gtk3.ui b/resources/ui/gtk3.ui index bfd9940..44a8eb1 100644 --- a/resources/ui/gtk3.ui +++ b/resources/ui/gtk3.ui @@ -482,7 +482,6 @@ none - 1 @@ -514,10 +513,12 @@ - - edit-clear-symbolic - 1 - + + + edit-clear-symbolic + 1 + + Reset to Default Value