🎉 Allow setting actor transitions in overview
This commit is contained in:
+6
-18
@@ -42,7 +42,8 @@ var TVEffect = class TVEffect {
|
||||
|
||||
// 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. the '*-close-effect').
|
||||
// effect is enabled currently (e.g. '*-close-effect'), and its animation time
|
||||
// (e.g. '*-animation-time').
|
||||
static getNick() {
|
||||
return 'tv';
|
||||
}
|
||||
@@ -81,24 +82,11 @@ var TVEffect = class TVEffect {
|
||||
return new Shader(settings);
|
||||
}
|
||||
|
||||
// This is also called from extension.js. It is used to tweak the ongoing transitions of
|
||||
// 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. Here, we modify this behavior as well as the transition duration.
|
||||
static tweakTransitions(actor, settings) {
|
||||
const animationTime = settings.get_int('tv-animation-time');
|
||||
|
||||
const tweakTransition = (property, value) => {
|
||||
const transition = actor.get_transition(property);
|
||||
if (transition) {
|
||||
transition.set_to(value);
|
||||
transition.set_duration(animationTime);
|
||||
}
|
||||
};
|
||||
|
||||
// For this effect, we scale the window only vertically.
|
||||
tweakTransition('opacity', 255);
|
||||
tweakTransition('scale-x', 1);
|
||||
tweakTransition('scale-y', 0.5);
|
||||
// GNOME Shell. For this effect, windows are scaled down vertically.
|
||||
static getCloseTransition(actor, settings) {
|
||||
return {'opacity': {to: 255}, 'scale-x': {to: 1.0}, 'scale-y': {to: 0.5}};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user