🔨 Initial attempt on window-opening animation

This commit is contained in:
Simon Schneegans
2022-01-27 05:07:30 +01:00
parent b6cb78330d
commit 6b218d049f
10 changed files with 405 additions and 267 deletions
+13 -6
View File
@@ -150,12 +150,19 @@ var SimpleFade = class SimpleFade {
return new Shader(settings);
}
// This is also called from extension.js. It is used to tweak the ongoing transition of
// the actor - usually windows are faded to transparency and scaled down slightly by
// GNOME Shell. For each property, you can set a "from", "to", and a "mode". For this
// effect, windows should neither be scaled nor faded.
static getCloseTransition(actor, settings) {
return {'opacity': {to: 255}, 'scale-x': {to: 1.0}, 'scale-y': {to: 1.0}};
// This is also called from extension.js. It is used to tweak a window's open / close
// transitions - usually windows are faded in / out and scaled up / down by GNOME Shell.
// forOpening is set to true if this is called for a window-open transition, for a
// window-close transition it is set to false. The modes can be set to any value from
// here: https://gjs-docs.gnome.org/clutter8~8_api/clutter.animationmode. This also
// determines how the uProgress uniform value will progress in the shader.
// For this effect, windows should neither be scaled nor faded.
static tweakTransition(actor, settings, forOpening) {
return {
'opacity': {from: 255, to: 255, mode: 4},
'scale-x': {from: 1.0, to: 1.0, mode: 4},
'scale-y': {from: 1.0, to: 1.0, mode: 4}
};
}
}