From 23a85798cad41dc884fbac8d11b08a54183eecd1 Mon Sep 17 00:00:00 2001 From: Simon Schneegans Date: Wed, 29 Mar 2023 20:23:40 +0200 Subject: [PATCH] :memo: Fix tutorial --- docs/how-to-create-new-effects.md | 313 +++++++++++++++--------------- 1 file changed, 154 insertions(+), 159 deletions(-) diff --git a/docs/how-to-create-new-effects.md b/docs/how-to-create-new-effects.md index 36314f4..4c68a2e 100644 --- a/docs/how-to-create-new-effects.md +++ b/docs/how-to-create-new-effects.md @@ -49,7 +49,7 @@ You will have to ... For enabling the new effect, the boolean settings keys `simple-fade-enable-effect` and `simple-fade-animation-time` are required. In this example, we also add a floating point value for storing another property of the effect - we will use them later in the tutorial. -Just copy the XML code below to the file [`schemas/org.gnome.shell.extensions.burn-my-windows.gschema.xml`](../schemas/org.gnome.shell.extensions.burn-my-windows.gschema.xml). +Just copy the XML code below to the file [`schemas/org.gnome.shell.extensions.burn-my-windows-profile.gschema.xml`](../schemas/org.gnome.shell.extensions.burn-my-windows-profile.gschema.xml). Just remember to replace `simple-fade` with your custom name! ```xml @@ -86,6 +86,20 @@ Please study this code carefully, all of it is explained with inline comments. Expand this to show the GLSL code. ```glsl +////////////////////////////////////////////////////////////////////////////////////////// +// ) ( // +// ( /( ( ( ) ( ( ( ( )\ ) ( ( // +// )\()) ))\ )( ( ( )\ ) )\))( )\ ( (()/( ( )\))( ( // +// ((_)\ /((_|()\ )\ ) )\ '(()/( ((_)()((_) )\ ) ((_)))\((_)()\ )\ // +// | |(_|_))( ((_)_(_/( _((_)) )(_)) _(()((_|_)_(_/( _| |((_)(()((_|(_) // +// | '_ \ || | '_| ' \)) | ' \()| || | \ V V / | ' \)) _` / _ \ V V (_-< // +// |_.__/\_,_|_| |_||_| |_|_|_| \_, | \_/\_/|_|_||_|\__,_\___/\_/\_//__/ // +// |__/ // +////////////////////////////////////////////////////////////////////////////////////////// + +// SPDX-FileCopyrightText: Your Name +// SPDX-License-Identifier: GPL-3.0-or-later + // The content from common.glsl is automatically prepended to each shader effect. This // provides the standard input: @@ -214,7 +228,6 @@ var SimpleFade = class { // binds all user interface elements to the respective settings keys of the profile. bindPreferences(dialog) { // Empty for now... Code is added here later in the tutorial! - return null; } // ---------------------------------------------------------------- API for extension.js @@ -265,7 +278,8 @@ There should be two sliders in this example: The animation duration and the widt If your effect supports GNOME Shell 3.3x _and_ GNOME Shell 40+, you will have to provide three `*.ui` files for this. This is because starting with GNOME Shell 40, the preference dialog uses GTK4, before it used to use GTK3. Starting with GNOME Shell 42, it uses `libadwaita` which requires different UI files again. -We will load the respective file in the `bindPreferences()` method of your new effect class. + +_:information_source: If you do not have the means to test your effect on different versions of GNOME, feel free to submit a pull request for one GNOME version only, I may then port your effect to other GNOME versions!_ Just save the code below to `resources/ui/gtk3/simple-fade.ui`, `resources/ui/gtk4/simple-fade.ui`, and `resources/ui/adw/simple-fade.ui` respectively. Remember to replace any occurrence of `simple-fade` with your effect's nick-name! @@ -281,7 +295,7 @@ SPDX-FileCopyrightText: Your Name SPDX-License-Identifier: GPL-3.0-or-later --> - + 5000 @@ -297,106 +311,97 @@ SPDX-License-Identifier: GPL-3.0-or-later 0.1 - - vertical + - + + none + - - none - - + + 0 - - 0 + - + + Animation Time [ms] + 0 + start + center + 1 + + + + + end + center + 1 + 0 + left + 300 + simple-fade-animation-time + + + + - - Animation Time [ms] - 0 - start - center - 1 - - - - - end - center - 1 - 0 - left - 300 - simple-fade-animation-time - - - - - - - edit-clear-symbolic - 1 - - - Reset to Default Value - + + edit-clear-symbolic + 1 + Reset to Default Value + + + + + + 0 - - 0 + - + + Fade Width + 0 + start + center + 1 + + + + + end + center + 1 + 2 + left + 300 + simple-fade-width + + + + - - Fade Width - 0 - start - center - 1 - - - - - end - center - 1 - 2 - left - 300 - simple-fade-width - - - - - - - edit-clear-symbolic - 1 - - - Reset to Default Value - + + edit-clear-symbolic + 1 + Reset to Default Value + - @@ -423,7 +428,7 @@ SPDX-FileCopyrightText: Your Name SPDX-License-Identifier: GPL-3.0-or-later --> - + 5000 @@ -439,97 +444,87 @@ SPDX-License-Identifier: GPL-3.0-or-later 0.1 - - vertical + - + + none + - - none - 1 - - + + 0 - - 0 + - - - - Animation Time [ms] - 0 - start - center - 1 - - - - - end - center - 1 - 0 - left - 300 - simple-fade-animation-time - - - - - edit-clear-symbolic - Reset to Default Value - - - + + Animation Time [ms] + 0 + start + center + 1 + + + + + end + center + 1 + 0 + left + 300 + simple-fade-animation-time + + + + + edit-clear-symbolic + Reset to Default Value + + + + + + 0 - - 0 + - - - - Fade Width - 0 - start - center - 1 - - - - - end - center - 1 - 2 - left - 300 - simple-fade-width - - - - - edit-clear-symbolic - Reset to Default Value - - - + + Fade Width + 0 + start + center + 1 + + + + + end + center + 1 + 2 + left + 300 + simple-fade-width + + + + + edit-clear-symbolic + Reset to Default Value + - @@ -570,7 +565,7 @@ SPDX-License-Identifier: GPL-3.0-or-later 0.1 - +