diff --git a/extension.js b/extension.js index 7cd46bc..2eebdf5 100644 --- a/extension.js +++ b/extension.js @@ -49,6 +49,9 @@ import TVEffect from './src/effects/TVEffect.js'; import TVGlitch from './src/effects/TVGlitch.js'; import UnicornFart from './src/effects/UnicornFart.js'; import Wisps from './src/effects/Wisps.js'; +import Mushroom from './src/effects/Mushroom.js'; + +import UnicornFart from './src/effects/UnicornFart.js'; diff --git a/metadata.json b/metadata.json index bccda7b..c6325bd 100644 --- a/metadata.json +++ b/metadata.json @@ -16,4 +16,5 @@ ], "url": "https://github.com/Schneegans/Burn-My-Windows", "version": 47 + } diff --git a/prefs.js b/prefs.js index ea60c03..8c65cc9 100644 --- a/prefs.js +++ b/prefs.js @@ -193,13 +193,24 @@ export default class BurnMyWindowsPreferences extends ExtensionPreferences { this._searchEntry.connect('search-changed', () => { const query = this._searchEntry.get_text().toLowerCase(); - this._effectRows.forEach(er => { + this._effectRows.forEach(row => { if (query === '') { - er.show(); // Show all effects if query is empty + row.show(); // Show all effects if query is empty } else { // Show or hide each effect based on query match - const showEffect = er.name.toLowerCase().includes(query); - showEffect ? er.show() : er.hide(); + const showEffect = row.name.toLowerCase().includes(query); + + // old code + // showEffect ? er.show() : er.hide(); + + // new code ...auto-expand + if (showEffect) { + row.show(); + row.set_expanded(true); + } else { + row.set_expanded(false); + row.hide(); + } // TODO // maybe add a fuzzy search later diff --git a/resources/shaders/mushroom.frag b/resources/shaders/mushroom.frag index 6b81741..31ad164 100644 --- a/resources/shaders/mushroom.frag +++ b/resources/shaders/mushroom.frag @@ -367,7 +367,9 @@ vec4 getStars(vec2 starUV, float aspect, float progress, float oColorAlpha) //each star in each ring for (float s = 0.0; s < uStarCount; ++s) { + //this returns a Star + float a5ps = getStar( starUV, vec2( sin(progress * uRingRotation * 6.28 + (s*(6.28/uStarCount))) * aspect * 0.33 , y), //position (x, y) @@ -382,6 +384,7 @@ vec4 getStars(vec2 starUV, float aspect, float progress, float oColorAlpha) float depth = cos(progress * uRingRotation * 6.28 + (s*(6.28/uStarCount)) ); //if we want the star behind or infront of the window + if (depth < 0.0) { result = alphaOver(result,getStarColor(y,a5ps)); diff --git a/resources/shaders/rgbwarp.frag b/resources/shaders/rgbwarp.frag index 0fc18eb..428d649 100644 --- a/resources/shaders/rgbwarp.frag +++ b/resources/shaders/rgbwarp.frag @@ -45,6 +45,7 @@ float FadeInOut(float t, float power) } + void main() { // Calculate the progression value based on the animation direction. @@ -62,6 +63,7 @@ void main() { // w is the wave float w = 0.0; + //w will be used to calculate the the size of the wave float p = mix(0.0, 1.0 + uWavesize, progress); w = 1.0 - abs(p - f.y); @@ -72,11 +74,13 @@ void main() { vec4 oColor = vec4(0.0); // outputs for RGB is based on the color of the window, times uStreatch(RG and B), and another multipler for the brightness + oColor.r = getInputColor(uv + vec2(0.0,w * uStretchR ) ).r * mix(1.0, uBrightness, FadeInOut(progress,4)); oColor.g = getInputColor(uv + vec2(0.0,w * uStretchG ) ).g * mix(1.0, uBrightness, FadeInOut(progress,4)); oColor.b = getInputColor(uv + vec2(0.0,w * uStretchB ) ).b * mix(1.0, uBrightness, FadeInOut(progress,4)); //if you can think of a better way to handle the alpha ... try that + if (oColor.r + oColor.g + oColor.b > 0.0) { oColor.a = getInputColor(uv).a ; @@ -87,5 +91,6 @@ void main() { } + setOutputColor(oColor); } diff --git a/resources/shaders/team-rocket.frag b/resources/shaders/team-rocket.frag index 63c7b3a..515c800 100644 --- a/resources/shaders/team-rocket.frag +++ b/resources/shaders/team-rocket.frag @@ -41,6 +41,7 @@ uniform float uSparkleSize; // the size of the star uniform bool uWinRot; //window rotation... but it's more of a warp uniform vec2 uSeed; // and random numbers + //use to scale the window vec2 scaleUV(vec2 uv, vec2 scale, vec2 centerOffset) { @@ -54,6 +55,7 @@ vec2 scaleUV(vec2 uv, vec2 scale, vec2 centerOffset) // scale from center uv = uv * 0.5 + 0.5; + return uv; } diff --git a/resources/shaders/unicorn-fart.frag b/resources/shaders/unicorn-fart.frag index 9ae9175..3b8a664 100644 --- a/resources/shaders/unicorn-fart.frag +++ b/resources/shaders/unicorn-fart.frag @@ -32,6 +32,7 @@ // The width of the fading effect is loaded from the settings. + //variables uniform float uSparkCount; //number of sparkles uniform vec2 uSparkStartEnd; // the start and end of the sparkles @@ -44,6 +45,7 @@ uniform float uBlurQuality; // blurquality for the window uniform float uSeed; // a random number + //particle colors uniform vec4 uSparkColor0; uniform vec4 uSparkColor1; @@ -518,6 +520,7 @@ void main() { oColor = alphaOver(oColor, getStars(mix(0.0001,0.999,ioSine))); } + //output setOutputColor(oColor); } \ No newline at end of file diff --git a/resources/ui/adw/prefs.ui b/resources/ui/adw/prefs.ui index 70d717d..f8d2fd5 100644 --- a/resources/ui/adw/prefs.ui +++ b/resources/ui/adw/prefs.ui @@ -63,7 +63,8 @@ SPDX-License-Identifier: GPL-3.0-or-later Effect Profile Constraints - Define when the current effect settings should be used. + Define when the current effect + settings should be used. @@ -181,7 +182,8 @@ SPDX-License-Identifier: GPL-3.0-or-later High Priority - Use this profile even if there are better matching profiles. + Use this profile even if there are + better matching profiles. 1 profile-high-priority diff --git a/src/Shader.js b/src/Shader.js index 2d19502..532df6c 100644 --- a/src/Shader.js +++ b/src/Shader.js @@ -59,7 +59,9 @@ export var Shader = GObject.registerClass({ 'end-animation': {} } }, + class Shader extends Shell.GLSLEffect { + // -------------------------------------------- // The constructor automagically loads the shader's source code (in // vfunc_build_pipeline()) from the resource file resources/shaders/.glsl @@ -207,4 +209,6 @@ export var Shader = GObject.registerClass({ // Add a trailing newline. Else the GLSL compiler complains... return common + '\n' + code + '\n'; } -}); \ No newline at end of file + +}); + diff --git a/src/ShaderFactory.js b/src/ShaderFactory.js index 6056262..06fbea7 100644 --- a/src/ShaderFactory.js +++ b/src/ShaderFactory.js @@ -61,7 +61,7 @@ export default class ShaderFactory { // Only try to register the new type once. if (GObject.type_from_name(typeName) == null) { const outerThis = this; - GObject.registerClass({GTypeName: typeName}, class ShaderImp extends Shader { + GObject.registerClass({GTypeName: typeName}, class ShaderImp extends Shader{ // This will actually load the GLSL source code from the resources. _init() { super._init(outerThis._nick); diff --git a/src/utils.js b/src/utils.js index ba87286..d84ab44 100644 --- a/src/utils.js +++ b/src/utils.js @@ -172,4 +172,6 @@ export function parseColor(string) { return [color.red / 255, color.green / 255, color.blue / 255, color.alpha / 255]; -} \ No newline at end of file + +} +