🔀 Merge pull request #231 from Schneegans/feature/glide

This commit is contained in:
Simon Schneegans
2022-11-02 22:07:40 +01:00
committed by GitHub
39 changed files with 831 additions and 3 deletions
-1
View File
@@ -105,7 +105,6 @@ jobs:
if: >
github.event_name == 'pull_request' ||
( contains(github.ref, 'main') && !contains(github.event.head_commit.message, '[no-ci]') ) ||
( contains(github.ref, 'develop') && !contains(github.event.head_commit.message, '[no-ci]') ) ||
contains(github.event.head_commit.message, '[run-ci]')
strategy:
fail-fast: false
+2
View File
@@ -34,6 +34,7 @@ Effect | Preview
**Energize A** <br> Beam your windows away! | <img src ="docs/pics/energizeA.gif" />
**Energize B** <br> Using different transporter technology results in an alternative visual effect. | <img src ="docs/pics/energizeB.gif" />
**Fire** <br> The classic effect inspired by Compiz. However, this is implemented using a GLSL shader and not with a particle system like in the old days. | <img src ="docs/pics/fire.gif" />
**Glide** <br> This very simple effect fades the window to transparency with subtle 3D effects. | <img src ="docs/pics/glide.gif" />
**Hexagon** <br> With glowing lines and hexagon-shaped tiles, this effect looks very sci-fi. | <img src ="docs/pics/hexagon.gif" />
**Incinerate** <br> A less snappy but definitely more fancy take on the fire effect. | <img src ="docs/pics/incinerate.gif" />
**Matrix** <br> Turn your windows into a shower of green letters! The color is actually configurable.| <img src ="docs/pics/matrix.gif" />
@@ -64,6 +65,7 @@ Below is a table which summarizes the current availability for all effects.
<tr><td>Energize A</td> <td>✅</td> <td>✅</td> <td>✅</td><td>✅</td><td>✅</td><td>✅</td><td>✅</td> </tr>
<tr><td>Energize B</td> <td>✅</td> <td>✅</td> <td>✅</td><td>✅</td><td>✅</td><td>✅</td><td>✅</td> </tr>
<tr><td>Fire</td> <td>✅</td> <td>✅</td> <td>✅</td><td>✅</td><td>✅</td><td>✅</td><td>✅</td> </tr>
<tr><td>Glide</td> <td>✅</td> <td>✅</td> <td>✅</td><td>✅</td><td>✅</td><td>✅</td><td>✅</td> </tr>
<tr><td>Hexagon</td> <td>✅</td> <td>✅</td> <td>✅</td><td>✅</td><td>✅</td><td>✅</td><td>✅</td> </tr>
<tr><td>Incinerate</td> <td>✅</td> <td>✅</td> <td>✅</td><td>✅</td><td>✅</td><td>✅</td><td>✅</td> </tr>
<tr><td>Matrix</td> <td> </td> <td> </td> <td>✅</td><td>✅</td><td>✅</td><td>✅</td><td> </td> </tr>
+4
View File
@@ -9,6 +9,10 @@ SPDX-License-Identifier: CC-BY-4.0
**Release Date:** TBD
#### New Features
* **New Effect: Glide.** A very subtle effect which simply fades the window and applies some 3D-like tilting and scaling.
#### Other Enhancements
* Burn-My-Windows now follows the [REUSE Specification](https://reuse.software/spec).
Binary file not shown.

After

Width:  |  Height:  |  Size: 544 KiB

+1
View File
@@ -57,6 +57,7 @@ class Extension {
new Me.imports.src.EnergizeA.EnergizeA(),
new Me.imports.src.EnergizeB.EnergizeB(),
new Me.imports.src.Fire.Fire(),
new Me.imports.src.Glide.Glide(),
new Me.imports.src.Hexagon.Hexagon(),
new Me.imports.src.Incinerate.Incinerate(),
new Me.imports.src.Matrix.Matrix(),
+1
View File
@@ -132,6 +132,7 @@ generate "energize-a" "Energize A [Burn-My-Windows]" "Beam your windows away"
generate "energize-b" "Energize B [Burn-My-Windows]" "Using different transporter technology results in an alternative visual effect"
generate "doom" "Doom [Burn-My-Windows]" "Melt your windows"
generate "fire" "Fire [Burn-My-Windows]" "The classic effect inspired by Compiz"
generate "glide" "Glide [Burn-My-Windows]" "Fade the window to transparency with subtle 3D effects"
generate "hexagon" "Hexagon [Burn-My-Windows]" "With glowing lines and hexagon-shaped tiles, this effect looks very sci-fi"
generate "incinerate" "Incinerate [Burn-My-Windows]" "A less snappy but definitely more fancy take on the fire effect"
generate "pixelate" "Pixelate [Burn-My-Windows]" "Pixelate the window and randomly hide the pixels"
+116
View File
@@ -0,0 +1,116 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
SPDX-FileCopyrightText: Simon Schneegans <code@simonschneegans.de>
SPDX-License-Identifier: GPL-3.0-or-later
-->
<ui version="4.0">
<class>BMWConfigForm</class>
<widget class="QWidget" name="BMWConfigForm">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>562</width>
<height>365</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Squish</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QSpinBox" name="kcfg_Duration">
<property name="suffix">
<string> milliseconds</string>
</property>
<property name="minimum">
<number>100</number>
</property>
<property name="maximum">
<number>9999</number>
</property>
<property name="singleStep">
<number>100</number>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Scale:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Duration:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QDoubleSpinBox" name="kcfg_Scale">
<property name="minimum">
<double>0.100000000000000</double>
</property>
<property name="maximum">
<double>1.000000000000000</double>
</property>
<property name="singleStep">
<double>0.1</double>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Tilt</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="kcfg_Squish">
<property name="maximum">
<double>1.000000000000000</double>
</property>
<property name="singleStep">
<double>0.1</double>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QDoubleSpinBox" name="kcfg_Tilt">
<property name="minimum">
<double>-1.000000000000000</double>
</property>
<property name="maximum">
<double>1.000000000000000</double>
</property>
<property name="singleStep">
<double>0.1</double>
</property>
</widget>
</item>
</layout>
</widget>
<resources />
<connections />
</ui>
+24
View File
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
SPDX-FileCopyrightText: Simon Schneegans <code@simonschneegans.de>
SPDX-License-Identifier: GPL-3.0-or-later
-->
<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd">
<kcfgfile name="" />
<group name="">
<entry name="Duration" type="UInt">
<default>250</default>
</entry>
<entry name="Scale" type="Double">
<default>0.9</default>
</entry>
<entry name="Squish" type="Double">
<default>0.1</default>
</entry>
<entry name="Tilt" type="Double">
<default>-0.3</default>
</entry>
</group>
</kcfg>
+10
View File
@@ -0,0 +1,10 @@
// SPDX-FileCopyrightText: Simon Schneegans <code@simonschneegans.de>
// SPDX-License-Identifier: GPL-3.0-or-later
// This part is automatically included in the effect's source during the build process.
// The code below is called whenever the user changes something in the configuration of
// the effect.
effect.setUniform(this.shader, 'uScale', effect.readConfig('Scale', 1.0));
effect.setUniform(this.shader, 'uSquish', effect.readConfig('Squish', 1.0));
effect.setUniform(this.shader, 'uTilt', effect.readConfig('Tilt', 1.0));
+1
View File
@@ -53,6 +53,7 @@ var PreferencesDialog = class PreferencesDialog {
new Me.imports.src.EnergizeA.EnergizeA(),
new Me.imports.src.EnergizeB.EnergizeB(),
new Me.imports.src.Fire.Fire(),
new Me.imports.src.Glide.Glide(),
new Me.imports.src.Hexagon.Hexagon(),
new Me.imports.src.Incinerate.Incinerate(),
new Me.imports.src.Matrix.Matrix(),
+5
View File
@@ -183,13 +183,18 @@ float getRelativeEdgeMask(float fadeAmount) {
// ------------------------------------------------------------------------------- 2D math
// Returns the shortest distance between the given point and the line defined by "origin"
// and "direction".
float distToLine(vec2 origin, vec2 direction, vec2 point) {
vec2 perpendicular = vec2(direction.y, -direction.x);
return abs(dot(normalize(perpendicular), origin - point));
}
// Returns a positive number if a -> b forms a clockwise corner, or a negative number if
// the corner is counter-clockwise.
float getWinding(vec2 a, vec2 b) { return cross(vec3(a, 0.0), vec3(b, 0.0)).z; }
// Rotates the given 2D vector a clockwise by the angle alpha (given in radians).
vec2 rotate(vec2 a, float angle) {
return vec2(a.x * cos(angle) - a.y * sin(angle), a.x * sin(angle) + a.y * cos(angle));
}
+47
View File
@@ -0,0 +1,47 @@
//////////////////////////////////////////////////////////////////////////////////////////
// ) ( //
// ( /( ( ( ) ( ( ( ( )\ ) ( ( //
// )\()) ))\ )( ( ( )\ ) )\))( )\ ( (()/( ( )\))( ( //
// ((_)\ /((_|()\ )\ ) )\ '(()/( ((_)()((_) )\ ) ((_)))\((_)()\ )\ //
// | |(_|_))( ((_)_(_/( _((_)) )(_)) _(()((_|_)_(_/( _| |((_)(()((_|(_) //
// | '_ \ || | '_| ' \)) | ' \()| || | \ V V / | ' \)) _` / _ \ V V (_-< //
// |_.__/\_,_|_| |_||_| |_|_|_| \_, | \_/\_/|_|_||_|\__,_\___/\_/\_//__/ //
// |__/ //
//////////////////////////////////////////////////////////////////////////////////////////
// SPDX-FileCopyrightText: Simon Schneegans <code@simonschneegans.de>
// SPDX-License-Identifier: GPL-3.0-or-later
// The content from common.glsl is automatically prepended to each shader effect.
uniform float uScale;
uniform float uSquish;
uniform float uTilt;
void main() {
// We reverse the progress for window opening.
float progress = easeOutQuad(uProgress);
progress = uForOpening ? 1.0 - progress : progress;
// Put texture coordinate origin to center of window.
vec2 coords = iTexCoord.st * 2.0 - 1.0;
// Scale image texture with progress.
coords /= mix(1.0, uScale, progress);
// Squish image texture vertically.
coords.y /= mix(1.0, (1.0 - 0.2 * uSquish), progress);
// 'Tilt' image texture around x-axis.
coords.x /= mix(1.0, 1.0 - 0.1 * uTilt * coords.y, progress);
// Move texture coordinate center to corner again.
coords = coords * 0.5 + 0.5;
vec4 oColor = getInputColor(coords);
// Dissolve window.
oColor.a = oColor.a * (uForOpening ? uProgress : pow(1.0 - uProgress, 2.0));
setOutputColor(oColor);
}
+254
View File
@@ -0,0 +1,254 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
SPDX-FileCopyrightText: Simon Schneegans <code@simonschneegans.de>
SPDX-License-Identifier: GPL-3.0-or-later
-->
<interface domain="burn-my-windows">
<object class="GtkAdjustment" id="glide-animation-time">
<property name="upper">2000</property>
<property name="lower">100</property>
<property name="step-increment">1</property>
<property name="page-increment">100</property>
</object>
<object class="GtkAdjustment" id="glide-scale">
<property name="upper">1</property>
<property name="lower">0.1</property>
<property name="step-increment">0.01</property>
<property name="page-increment">0.1</property>
</object>
<object class="GtkAdjustment" id="glide-squish">
<property name="upper">1</property>
<property name="lower">0</property>
<property name="step-increment">0.01</property>
<property name="page-increment">0.1</property>
</object>
<object class="GtkAdjustment" id="glide-tilt">
<property name="upper">1</property>
<property name="lower">-1</property>
<property name="step-increment">0.01</property>
<property name="page-increment">0.1</property>
</object>
<object class="GtkBox" id="glide-prefs">
<property name="orientation">vertical</property>
<child>
<object class="GtkFrame">
<child>
<object class="GtkListBox">
<property name="selection-mode">none</property>
<style>
<class name="rich-list" />
</style>
<child>
<object class="GtkListBoxRow">
<property name="margin-start">10</property>
<property name="margin-end">10</property>
<property name="margin-top">10</property>
<property name="margin-bottom">10</property>
<property name="activatable">0</property>
<child>
<object class="GtkBox">
<property name="spacing">8</property>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Animation Time [ms]</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkScale">
<property name="halign">end</property>
<property name="valign">center</property>
<property name="draw-value">1</property>
<property name="digits">0</property>
<property name="value-pos">left</property>
<property name="width-request">300</property>
<property name="adjustment">glide-animation-time</property>
</object>
</child>
<child>
<object class="GtkButton" id="reset-glide-animation-time">
<child>
<object class="GtkImage">
<property name="icon-name">edit-clear-symbolic</property>
<property name="icon-size">1</property>
</object>
</child>
<property name="tooltip-text" translatable="yes">Reset to Default Value</property>
<style>
<class name="flat" />
</style>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow">
<property name="margin-start">10</property>
<property name="margin-end">10</property>
<property name="margin-top">10</property>
<property name="margin-bottom">10</property>
<property name="activatable">0</property>
<child>
<object class="GtkBox">
<property name="spacing">8</property>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Scale</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkScale">
<property name="halign">end</property>
<property name="valign">center</property>
<property name="draw-value">1</property>
<property name="digits">2</property>
<property name="value-pos">left</property>
<property name="width-request">300</property>
<property name="adjustment">glide-scale</property>
</object>
</child>
<child>
<object class="GtkButton" id="reset-glide-scale">
<child>
<object class="GtkImage">
<property name="icon-name">edit-clear-symbolic</property>
<property name="icon-size">1</property>
</object>
</child>
<property name="tooltip-text" translatable="yes">Reset to Default Value</property>
<style>
<class name="flat" />
</style>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow">
<property name="margin-start">10</property>
<property name="margin-end">10</property>
<property name="margin-top">10</property>
<property name="margin-bottom">10</property>
<property name="activatable">0</property>
<child>
<object class="GtkBox">
<property name="spacing">8</property>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Squish</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkScale">
<property name="halign">end</property>
<property name="valign">center</property>
<property name="draw-value">1</property>
<property name="digits">2</property>
<property name="value-pos">left</property>
<property name="width-request">300</property>
<property name="adjustment">glide-squish</property>
</object>
</child>
<child>
<object class="GtkButton" id="reset-glide-squish">
<child>
<object class="GtkImage">
<property name="icon-name">edit-clear-symbolic</property>
<property name="icon-size">1</property>
</object>
</child>
<property name="tooltip-text" translatable="yes">Reset to Default Value</property>
<style>
<class name="flat" />
</style>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow">
<property name="margin-start">10</property>
<property name="margin-end">10</property>
<property name="margin-top">10</property>
<property name="margin-bottom">10</property>
<property name="activatable">0</property>
<child>
<object class="GtkBox">
<property name="spacing">8</property>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Tilt</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkScale">
<property name="halign">end</property>
<property name="valign">center</property>
<property name="draw-value">1</property>
<property name="digits">2</property>
<property name="value-pos">left</property>
<property name="width-request">300</property>
<property name="adjustment">glide-tilt</property>
</object>
</child>
<child>
<object class="GtkButton" id="reset-glide-tilt">
<child>
<object class="GtkImage">
<property name="icon-name">edit-clear-symbolic</property>
<property name="icon-size">1</property>
</object>
</child>
<property name="tooltip-text" translatable="yes">Reset to Default Value</property>
<style>
<class name="flat" />
</style>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</interface>
+216
View File
@@ -0,0 +1,216 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
SPDX-FileCopyrightText: Simon Schneegans <code@simonschneegans.de>
SPDX-License-Identifier: GPL-3.0-or-later
-->
<interface domain="burn-my-windows">
<object class="GtkBox" id="glide-prefs">
<property name="orientation">vertical</property>
<child>
<object class="GtkFrame">
<child>
<object class="GtkListBox">
<property name="selection-mode">none</property>
<property name="show-separators">1</property>
<style>
<class name="rich-list" />
</style>
<child>
<object class="GtkListBoxRow">
<property name="activatable">0</property>
<child>
<object class="GtkBox">
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Animation Time [ms]</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkScale">
<property name="halign">end</property>
<property name="valign">center</property>
<property name="draw-value">1</property>
<property name="digits">0</property>
<property name="value-pos">left</property>
<property name="width-request">300</property>
<property name="adjustment">
<object class="GtkAdjustment" id="glide-animation-time">
<property name="upper">2000</property>
<property name="lower">100</property>
<property name="step-increment">1</property>
<property name="page-increment">100</property>
</object>
</property>
</object>
</child>
<child>
<object class="GtkButton" id="reset-glide-animation-time">
<property name="icon-name">edit-clear-symbolic</property>
<property name="tooltip-text" translatable="yes">Reset to Default Value</property>
<style>
<class name="flat" />
</style>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow">
<property name="activatable">0</property>
<child>
<object class="GtkBox">
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Scale</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkScale">
<property name="halign">end</property>
<property name="valign">center</property>
<property name="draw-value">1</property>
<property name="digits">2</property>
<property name="value-pos">left</property>
<property name="width-request">300</property>
<property name="adjustment">
<object class="GtkAdjustment" id="glide-scale">
<property name="upper">1</property>
<property name="lower">0.1</property>
<property name="step-increment">0.01</property>
<property name="page-increment">0.1</property>
</object>
</property>
</object>
</child>
<child>
<object class="GtkButton" id="reset-glide-scale">
<property name="icon-name">edit-clear-symbolic</property>
<property name="tooltip-text" translatable="yes">Reset to Default Value</property>
<style>
<class name="flat" />
</style>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow">
<property name="activatable">0</property>
<child>
<object class="GtkBox">
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Squish</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkScale">
<property name="halign">end</property>
<property name="valign">center</property>
<property name="draw-value">1</property>
<property name="digits">2</property>
<property name="value-pos">left</property>
<property name="width-request">300</property>
<property name="adjustment">
<object class="GtkAdjustment" id="glide-squish">
<property name="upper">1</property>
<property name="lower">0</property>
<property name="step-increment">0.01</property>
<property name="page-increment">0.1</property>
</object>
</property>
</object>
</child>
<child>
<object class="GtkButton" id="reset-glide-squish">
<property name="icon-name">edit-clear-symbolic</property>
<property name="tooltip-text" translatable="yes">Reset to Default Value</property>
<style>
<class name="flat" />
</style>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBoxRow">
<property name="activatable">0</property>
<child>
<object class="GtkBox">
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Tilt</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkScale">
<property name="halign">end</property>
<property name="valign">center</property>
<property name="draw-value">1</property>
<property name="digits">2</property>
<property name="value-pos">left</property>
<property name="width-request">300</property>
<property name="adjustment">
<object class="GtkAdjustment" id="glide-tilt">
<property name="upper">1</property>
<property name="lower">-1</property>
<property name="step-increment">0.01</property>
<property name="page-increment">0.1</property>
</object>
</property>
</object>
</child>
<child>
<object class="GtkButton" id="reset-glide-tilt">
<property name="icon-name">edit-clear-symbolic</property>
<property name="tooltip-text" translatable="yes">Reset to Default Value</property>
<style>
<class name="flat" />
</style>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</interface>
@@ -297,6 +297,46 @@ SPDX-License-Identifier: CC0-1.0
<description>The fifth color of the fire gradient.</description>
</key>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- Glide Options -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<key name="glide-close-effect" type="b">
<default>true</default>
<summary>Glide Close Effect</summary>
<description>Use the glide effect for window closing.</description>
</key>
<key name="glide-open-effect" type="b">
<default>false</default>
<summary>Glide Open Effect</summary>
<description>Use the glide effect for window opening.</description>
</key>
<key name="glide-animation-time" type="i">
<default>250</default>
<summary>Glide Animation Time</summary>
<description>The time the glide effect takes.</description>
</key>
<key name="glide-scale" type="d">
<default>0.9</default>
<summary>Glide Scale</summary>
<description>The scale of the window.</description>
</key>
<key name="glide-squish" type="d">
<default>0.1</default>
<summary>Glide Squish</summary>
<description>The amount of squishing.</description>
</key>
<key name="glide-tilt" type="d">
<default>-0.3</default>
<summary>Glide Tilt</summary>
<description>The amount of tilting.</description>
</key>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- Matrix Options -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+106
View File
@@ -0,0 +1,106 @@
//////////////////////////////////////////////////////////////////////////////////////////
// ) ( //
// ( /( ( ( ) ( ( ( ( )\ ) ( ( //
// )\()) ))\ )( ( ( )\ ) )\))( )\ ( (()/( ( )\))( ( //
// ((_)\ /((_|()\ )\ ) )\ '(()/( ((_)()((_) )\ ) ((_)))\((_)()\ )\ //
// | |(_|_))( ((_)_(_/( _((_)) )(_)) _(()((_|_)_(_/( _| |((_)(()((_|(_) //
// | '_ \ || | '_| ' \)) | ' \()| || | \ V V / | ' \)) _` / _ \ V V (_-< //
// |_.__/\_,_|_| |_||_| |_|_|_| \_, | \_/\_/|_|_||_|\__,_\___/\_/\_//__/ //
// |__/ //
//////////////////////////////////////////////////////////////////////////////////////////
// SPDX-FileCopyrightText: Simon Schneegans <code@simonschneegans.de>
// SPDX-License-Identifier: GPL-3.0-or-later
'use strict';
const GObject = imports.gi.GObject;
const _ = imports.gettext.domain('burn-my-windows').gettext;
const ExtensionUtils = imports.misc.extensionUtils;
const Me = imports.misc.extensionUtils.getCurrentExtension();
const utils = Me.imports.src.utils;
const ShaderFactory = Me.imports.src.ShaderFactory.ShaderFactory;
//////////////////////////////////////////////////////////////////////////////////////////
// This very simple effect fades the window to transparency with subtle 3D effects. //
//////////////////////////////////////////////////////////////////////////////////////////
// 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.
var Glide = class {
// The constructor creates a ShaderFactory which will be used by extension.js to create
// shader instances for this effect. The shaders will be automagically created using the
// GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each
// newly created shader instance.
constructor() {
this.shaderFactory = new ShaderFactory(this.getNick(), (shader) => {
// Store uniform locations of newly created shaders.
shader._uScale = shader.get_uniform_location('uScale');
shader._uSquish = shader.get_uniform_location('uSquish');
shader._uTilt = shader.get_uniform_location('uTilt');
// Write all uniform values at the start of each animation.
shader.connect('begin-animation', (shader, settings) => {
// clang-format off
shader.set_uniform_float(shader._uScale, 1, [settings.get_double('glide-scale')]);
shader.set_uniform_float(shader._uSquish, 1, [settings.get_double('glide-squish')]);
shader.set_uniform_float(shader._uTilt, 1, [settings.get_double('glide-tilt')]);
// clang-format on
});
});
}
// ---------------------------------------------------------------------------- metadata
// The effect is available on all GNOME Shell versions supported by this extension.
getMinShellVersion() {
return [3, 36];
}
// This will be called in various places where a unique identifier for this effect is
// required. It should match the prefix of the settings keys which store whether the
// effect is enabled currently (e.g. '*-close-effect'), and its animation time
// (e.g. '*-animation-time').
getNick() {
return 'glide';
}
// This will be shown in the sidebar of the preferences dialog as well as in the
// drop-down menus where the user can choose the effect.
getLabel() {
return _('Glide');
}
// -------------------------------------------------------------------- API for prefs.js
// This is called by the preferences dialog. It loads the settings page for this effect,
// and binds all properties to the settings.
getPreferences(dialog) {
// Add the settings page to the builder.
dialog.getBuilder().add_from_resource(`/ui/${utils.getGTKString()}/Glide.ui`);
// Bind all properties.
dialog.bindAdjustment('glide-animation-time');
dialog.bindAdjustment('glide-scale');
dialog.bindAdjustment('glide-squish');
dialog.bindAdjustment('glide-tilt');
// Finally, return the new settings page.
return dialog.getBuilder().get_object('glide-prefs');
}
// ---------------------------------------------------------------- API for extension.js
// The getActorScale() is called from extension.js to adjust the actor's size during the
// animation. This is useful if the effect requires drawing something beyond the usual
// bounds of the actor. This only works for GNOME 3.38+.
getActorScale(settings) {
return {x: 1.0, y: 1.0};
}
}
+2 -2
View File
@@ -46,7 +46,7 @@ var PixelWipe = class {
// Write all uniform values at the start of each animation.
shader.connect('begin-animation', (shader, settings, forOpening, actor) => {
// Because the actor position may change after the begin-animation signal is
// called, we set the uDirection uniform during the update callback.
// called, we set the uStartPos uniform during the update callback.
this._startPointerPos = global.get_pointer();
this._actor = actor;
@@ -55,7 +55,7 @@ var PixelWipe = class {
// clang-format on
});
// We set the uDirection uniform during the update callback as the actor position
// We set the uStartPos uniform during the update callback as the actor position
// may not be set up properly before the begin animation callback.
shader.connect('update-animation', (shader) => {
if (this._startPointerPos) {
+1
View File
@@ -185,6 +185,7 @@ set_setting "test-mode" true
capture_effect "energize-a"
capture_effect "energize-b"
capture_effect "fire"
capture_effect "glide"
capture_effect "hexagon"
capture_effect "incinerate"
capture_effect "pixelate"
Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B

+1
View File
@@ -210,6 +210,7 @@ set_setting "test-mode" true
test_effect "energize-a"
test_effect "energize-b"
test_effect "fire"
test_effect "glide"
test_effect "hexagon"
test_effect "incinerate"
test_effect "pixelate"