diff --git a/prefs.js b/prefs.js index 3882c9b..d007495 100644 --- a/prefs.js +++ b/prefs.js @@ -178,6 +178,28 @@ export default class BurnMyWindowsPreferences extends ExtensionPreferences { }); }); + this._searchEntry = this._builder.get_object("search_entry") + this._searchEntry.connect('search-changed', () => { + const query = this._searchEntry.get_text().toLowerCase(); + + this._effectRows.forEach(er => { + if (query === "") { + er.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(); + + //TODO + //maybe add a fuzzy search later + /* + const showEffect = utils.fuzzyMatch(er.name.toLowerCase(), query.toLowerCase()); + showEffect ? er.show() : er.hide(); + */ + } + }); + }); + // Then add a preferences group for the effect expander rows. const group = this._builder.get_object('effects-group'); @@ -239,6 +261,8 @@ export default class BurnMyWindowsPreferences extends ExtensionPreferences { row.set_title(effect.getLabel()); } + row.name = effect.getLabel() + effect?.description !== undefined ? effect?.description : "" ; + // Un-expand any previously expanded effect row. This way we ensure that there // is only one expanded row at any time. if (hasPrefs) { diff --git a/resources/ui/adw/prefs.ui b/resources/ui/adw/prefs.ui index 6af6fca..ac09a4c 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 @@ -214,39 +216,130 @@ SPDX-License-Identifier: GPL-3.0-or-later + + + + 20 + 20 + 20 + 20 + - - 20 - 20 - 20 - 20 - Effect Selection - If multiple are selected, one is chosen randomly. - - - - center - + + + + + 5 + 5 - - All + + Effect Selection + If multiple are selected, one is chosen randomly. + + 0 + 0 + 8 + - - - None - - + + + + Search... + + 0 + 1 + 5 + + + + + + + + + + + horizontal + true + true + + 5 + 1 + 4 + + + + + + + All + + + + + + None + + + + + + + + + + 10 + 0 + 0 + 0 + + + + + + \ No newline at end of file diff --git a/src/effects/Apparition.js b/src/effects/Apparition.js index f770e71..5e8849e 100644 --- a/src/effects/Apparition.js +++ b/src/effects/Apparition.js @@ -27,6 +27,7 @@ const _ = await utils.importGettext(); // This effect hides the actor by violently sucking it into the void of magic. // ////////////////////////////////////////////////////////////////////////////////////////// + // The effect class can be used to get some metadata (like the effect's name or supported // GNOME Shell versions), to initialize the respective page of the settings dialog, as // well as to create the actual shader for the effect. @@ -80,6 +81,10 @@ export default class Effect { return _('Apparition'); } + //this can be used for searching, and helping people find the effect they are looking for + static description = "The Apparition effect makes the actor disappear by drawing it into a vortex-like void, accompanied by shaking, twirling, and suction animations to create a dramatic vanishing effect."; + + // -------------------------------------------------------------------- API for prefs.js // This is called by the preferences dialog whenever a new effect profile is loaded. It diff --git a/src/effects/BrokenGlass.js b/src/effects/BrokenGlass.js index f31efb7..3d917ae 100644 --- a/src/effects/BrokenGlass.js +++ b/src/effects/BrokenGlass.js @@ -138,6 +138,10 @@ export default class Effect { return _('Broken Glass'); } + //this can be used for searching, and helping people find the effect they are looking for + static description = "The Broken Glass effect shatters the window into independent shards, simulating a glass-breaking effect with pieces scaling, rotating, and moving as if blown away from a central epicenter. The shards can appear to break away from the cursor's position if enabled."; + + // -------------------------------------------------------------------- API for prefs.js // This is called by the preferences dialog whenever a new effect profile is loaded. It diff --git a/src/effects/Doom.js b/src/effects/Doom.js index 7afa97c..b6ec83a 100644 --- a/src/effects/Doom.js +++ b/src/effects/Doom.js @@ -87,6 +87,10 @@ export default class Effect { return _('Doom'); } + //this can be used for searching, and helping people find the effect they are looking for + static description = "The Doom effect melts the window, creating a vertical, pixelated distortion inspired by the classic screen transitions of the original Doom game. The effect stretches and scales the window, giving it a liquefied appearance as it dissolves downward."; + + // -------------------------------------------------------------------- API for prefs.js // This is called by the preferences dialog whenever a new effect profile is loaded. It diff --git a/src/effects/EnergizeA.js b/src/effects/EnergizeA.js index 3b1b84b..a66bed7 100644 --- a/src/effects/EnergizeA.js +++ b/src/effects/EnergizeA.js @@ -74,6 +74,10 @@ export default class Effect { return _('Energize A'); } + //this can be used for searching, and helping people find the effect they are looking for + static description = "The Energize A effect resembles the classic transporter effect from Star Trek: The Original Series, with a glowing color and scale transformation that creates an appearance of the window being transported or energized."; + + // -------------------------------------------------------------------- API for prefs.js // This is called by the preferences dialog whenever a new effect profile is loaded. It diff --git a/src/effects/EnergizeB.js b/src/effects/EnergizeB.js index 610a81c..63ce597 100644 --- a/src/effects/EnergizeB.js +++ b/src/effects/EnergizeB.js @@ -75,6 +75,10 @@ export default class Effect { return _('Energize B'); } + //this can be used for searching, and helping people find the effect they are looking for + static description = "The Energize B effect mimics the transporter effect from Star Trek: The Next Generation, with a smooth color glow and scale adjustment, creating an appearance of the window being energized or transported in a futuristic style."; + + // -------------------------------------------------------------------- API for prefs.js // This is called by the preferences dialog whenever a new effect profile is loaded. It diff --git a/src/effects/Fire.js b/src/effects/Fire.js index 6ea498d..a6472a1 100644 --- a/src/effects/Fire.js +++ b/src/effects/Fire.js @@ -96,6 +96,10 @@ export default class Effect { return _('Fire'); } + //this can be used for searching, and helping people find the effect they are looking for + static description = "The Fire effect adds a dynamic fire-like animation to the window, using a vertical noise shader to simulate flames with customizable color gradients and movement speed. This effect pays homage to the classic Compiz fire effect, with a modern implementation through shader techniques."; + + // -------------------------------------------------------------------- API for prefs.js // This is called by the preferences dialog whenever a new effect profile is loaded. It diff --git a/src/effects/Glide.js b/src/effects/Glide.js index 7aee968..4564302 100644 --- a/src/effects/Glide.js +++ b/src/effects/Glide.js @@ -78,6 +78,10 @@ export default class Effect { return _('Glide'); } + //this can be used for searching, and helping people find the effect they are looking for + static description = "The Glide effect gently fades the window to transparency while adding a subtle 3D look through scale, squish, tilt, and shift transformations, creating a smooth, immersive transition."; + + // -------------------------------------------------------------------- API for prefs.js // This is called by the preferences dialog whenever a new effect profile is loaded. It diff --git a/src/effects/Glitch.js b/src/effects/Glitch.js index 492d6e1..fd817b9 100644 --- a/src/effects/Glitch.js +++ b/src/effects/Glitch.js @@ -80,6 +80,10 @@ export default class Effect { return _('Glitch'); } + //this can be used for searching, and helping people find the effect they are looking for + static description = "The Glitch effect introduces visual distortions that mimic digital glitches, adding randomized color shifts, scaling, and jitter to create a dynamic, corrupted look for the window."; + + // -------------------------------------------------------------------- API for prefs.js // This is called by the preferences dialog whenever a new effect profile is loaded. It diff --git a/src/effects/Hexagon.js b/src/effects/Hexagon.js index 5adb59c..fb223a8 100644 --- a/src/effects/Hexagon.js +++ b/src/effects/Hexagon.js @@ -83,6 +83,10 @@ export default class Effect { return _('Hexagon'); } + //this can be used for searching, and helping people find the effect they are looking for + static description = "The Hexagon effect overlays a glowing hexagonal grid on the window, gradually shrinking each hexagon cell until the window is completely dissolved. The effect includes customizable line color, glow color, scale, and line width, adding a futuristic grid-based dissolution."; + + // -------------------------------------------------------------------- API for prefs.js // This is called by the preferences dialog whenever a new effect profile is loaded. It diff --git a/src/effects/Incinerate.js b/src/effects/Incinerate.js index beb1e06..ee139b6 100644 --- a/src/effects/Incinerate.js +++ b/src/effects/Incinerate.js @@ -126,6 +126,10 @@ export default class Effect { return _('Incinerate'); } + //this can be used for searching, and helping people find the effect they are looking for + static description = "The Incinerate effect simulates a burning transition where flames consume the window, starting from a random edge or the mouse pointer position. This fiery effect includes customizable color, scale, and turbulence, creating a dramatic dissolve into ashes."; + + // -------------------------------------------------------------------- API for prefs.js // This is called by the preferences dialog whenever a new effect profile is loaded. It diff --git a/src/effects/Matrix.js b/src/effects/Matrix.js index e244623..16b6998 100644 --- a/src/effects/Matrix.js +++ b/src/effects/Matrix.js @@ -109,6 +109,10 @@ export default class Effect { return _('Matrix'); } + //this can be used for searching, and helping people find the effect they are looking for + static description = "The Matrix effect overlays a cascading grid of random letters, mimicking the iconic 'Matrix' code with customizable trail and tip colors, randomness, and letter size. The letters flow downward at variable speeds, creating a dynamic, glitchy animation reminiscent of digital rain."; + + // -------------------------------------------------------------------- API for prefs.js // This is called by the preferences dialog whenever a new effect profile is loaded. It diff --git a/src/effects/PaintBrush.js b/src/effects/PaintBrush.js index 4a90729..e28315c 100644 --- a/src/effects/PaintBrush.js +++ b/src/effects/PaintBrush.js @@ -101,6 +101,10 @@ export default class Effect { return _('Paint Brush'); } + //this can be used for searching, and helping people find the effect they are looking for + static description = "The Paint Brush effect overlays the window with thick brush strokes, giving it an artistic, hand-painted appearance. The brush size is customizable, adding a tactile, textured look reminiscent of painted canvas."; + + // -------------------------------------------------------------------- API for prefs.js // This is called by the preferences dialog whenever a new effect profile is loaded. It diff --git a/src/effects/PixelWheel.js b/src/effects/PixelWheel.js index af74c72..29ca602 100644 --- a/src/effects/PixelWheel.js +++ b/src/effects/PixelWheel.js @@ -74,6 +74,10 @@ export default class Effect { return _('Pixel Wheel'); } + //this can be used for searching, and helping people find the effect they are looking for + static description = "The Pixel Wheel effect pixelates the window and gradually obscures it in a wheel-like pattern with customizable pixel size and spoke count, creating a unique radial fade-out transition."; + + // -------------------------------------------------------------------- API for prefs.js // This is called by the preferences dialog whenever a new effect profile is loaded. It diff --git a/src/effects/PixelWipe.js b/src/effects/PixelWipe.js index 6f9a3bc..8320b6f 100644 --- a/src/effects/PixelWipe.js +++ b/src/effects/PixelWipe.js @@ -100,6 +100,10 @@ export default class Effect { return _('Pixel Wipe'); } + //this can be used for searching, and helping people find the effect they are looking for + static description = "The Pixel Wipe effect pixelates the window and gradually hides pixels in a radial pattern starting from the mouse pointer position, offering a unique transition with a customizable pixel size."; + + // -------------------------------------------------------------------- API for prefs.js // This is called by the preferences dialog whenever a new effect profile is loaded. It diff --git a/src/effects/Pixelate.js b/src/effects/Pixelate.js index 1730b59..d7803f7 100644 --- a/src/effects/Pixelate.js +++ b/src/effects/Pixelate.js @@ -74,6 +74,10 @@ export default class Effect { return _('Pixelate'); } + //this can be used for searching, and helping people find the effect they are looking for + static description = "The Pixelate effect transforms the window into a pixelated mosaic, gradually obscuring it by increasing pixel size and randomly hiding pixels until the window fully disappears. This effect offers a playful, retro-inspired transition."; + + // -------------------------------------------------------------------- API for prefs.js // This is called by the preferences dialog whenever a new effect profile is loaded. It diff --git a/src/effects/Portal.js b/src/effects/Portal.js index 21f7a4e..8ac5178 100644 --- a/src/effects/Portal.js +++ b/src/effects/Portal.js @@ -82,6 +82,10 @@ export default class Effect { return _('Portal'); } + //this can be used for searching, and helping people find the effect they are looking for + static description = "The Portal effect creates a swirling, colorful portal animation that teleports the window as if through an alternate dimension. With customizable color, rotation speed, and whirling details, it adds a whimsical, otherworldly transition reminiscent of sci-fi portals."; + + // -------------------------------------------------------------------- API for prefs.js // This is called by the preferences dialog whenever a new effect profile is loaded. It diff --git a/src/effects/SnapOfDisintegration.js b/src/effects/SnapOfDisintegration.js index 7a76611..a404c80 100644 --- a/src/effects/SnapOfDisintegration.js +++ b/src/effects/SnapOfDisintegration.js @@ -110,6 +110,9 @@ export default class Effect { return _('Snap of Disintegration'); } + //this can be used for searching, and helping people find the effect they are looking for + static description = "The Snap of Disintegration effect dissolves the window into a cloud of dust particles, simulating a gradual disintegration. Using a layered dust texture, this effect creates the appearance of the window breaking apart into floating particles with customizable color and scale."; + // -------------------------------------------------------------------- API for prefs.js // This is called by the preferences dialog whenever a new effect profile is loaded. It diff --git a/src/effects/TRexAttack.js b/src/effects/TRexAttack.js index 617453c..9437e1d 100644 --- a/src/effects/TRexAttack.js +++ b/src/effects/TRexAttack.js @@ -109,6 +109,10 @@ export default class Effect { return _('T-Rex Attack'); } + //this can be used for searching, and helping people find the effect they are looking for + static description = "The T-Rex Attack effect simulates a window being violently torn apart by claw scratches. With customizable claw size, color, and warp intensity, this effect creates a dramatic and ferocious attack animation, as if a T-Rex has ripped through the screen."; + + // -------------------------------------------------------------------- API for prefs.js // This is called by the preferences dialog whenever a new effect profile is loaded. It diff --git a/src/effects/TVEffect.js b/src/effects/TVEffect.js index f551f6f..99d3aad 100644 --- a/src/effects/TVEffect.js +++ b/src/effects/TVEffect.js @@ -73,6 +73,10 @@ export default class Effect { return _('TV Effect'); } + //this can be used for searching, and helping people find the effect they are looking for + static description = "The TV Effect fades the window out by first making it transparent from the top and bottom edges towards the center, then collapsing the remaining line from the sides to the middle, mimicking an old television shutdown effect with a customizable color."; + + // -------------------------------------------------------------------- API for prefs.js // This is called by the preferences dialog whenever a new effect profile is loaded. It diff --git a/src/effects/TVGlitch.js b/src/effects/TVGlitch.js index b50fa8d..32ecbd6 100644 --- a/src/effects/TVGlitch.js +++ b/src/effects/TVGlitch.js @@ -81,6 +81,10 @@ export default class Effect { return _('TV Glitch'); } + //this can be used for searching, and helping people find the effect they are looking for + static description = "The TV Glitch effect combines a glitchy distortion with a TV shutdown animation. The effect distorts the window with randomized pixelation, scale, and speed before collapsing into a central line, creating a retro, glitchy TV shutdown experience."; + + // -------------------------------------------------------------------- API for prefs.js // This is called by the preferences dialog whenever a new effect profile is loaded. It diff --git a/src/effects/Wisps.js b/src/effects/Wisps.js index aa8482c..62aee62 100644 --- a/src/effects/Wisps.js +++ b/src/effects/Wisps.js @@ -85,6 +85,10 @@ export default class Effect { return _('Wisps'); } + //this can be used for searching, and helping people find the effect they are looking for + static description = "The Wisps effect carries the window away with a dreamy overlay of animated, fairy-like points that drift across the screen. This ethereal effect uses multiple grids of colorful, randomly moving points, with customizable colors and scale, to create a magical transition."; + + // -------------------------------------------------------------------- API for prefs.js // This is called by the preferences dialog whenever a new effect profile is loaded. It diff --git a/src/utils.js b/src/utils.js index 73ad404..f117d82 100644 --- a/src/utils.js +++ b/src/utils.js @@ -173,3 +173,19 @@ export function parseColor(string) { return [color.red / 255, color.green / 255, color.blue / 255, color.alpha / 255]; } + + +//used for searching +// Simple fuzzy match function +//NOTE: i'll improve the fuzzy function before rolling this out +/* +function fuzzyMatch(text, query) { + let queryIndex = 0; + for (let i = 0; i < text.length && queryIndex < query.length; i++) { + if (text[i] === query[queryIndex]) { + queryIndex++; + } + } + return queryIndex === query.length; // Returns true if all chars in query matched in order +} +*/ \ No newline at end of file