🔧 Use opacity transition for uProgress
This commit is contained in:
+20
-17
@@ -97,7 +97,7 @@ class Extension {
|
|||||||
// actor. The window preview in the overview is basically a Clutter.Clone which
|
// actor. The window preview in the overview is basically a Clutter.Clone which
|
||||||
// shows the original window.
|
// shows the original window.
|
||||||
if (Main.overview.visible && !Main.overview.closing) {
|
if (Main.overview.visible && !Main.overview.closing) {
|
||||||
const id = actor.connect('show', () => {
|
const id = actor.connect('notify::mapped', () => {
|
||||||
extensionThis._setupEffect(actor, true);
|
extensionThis._setupEffect(actor, true);
|
||||||
actor.disconnect(id);
|
actor.disconnect(id);
|
||||||
});
|
});
|
||||||
@@ -405,27 +405,21 @@ class Extension {
|
|||||||
transition = actor.get_transition(property);
|
transition = actor.get_transition(property);
|
||||||
}
|
}
|
||||||
|
|
||||||
// For some reason, there are rare cases, where no transition is set up. We do not
|
// Tweak the transition according to the config object. For some reason, there are
|
||||||
// try to continue here...
|
// rare cases, where no transition is set up. This happens from time to time...
|
||||||
if (!transition) {
|
if (transition) {
|
||||||
utils.debug('Failed to set up transitions.');
|
transition.set_duration(duration);
|
||||||
this._fixAnimationTimes(isDialogWindow, forOpening, null);
|
transition.set_to(config[property].to);
|
||||||
return;
|
transition.set_from(config[property].from);
|
||||||
|
transition.set_progress_mode(config[property].mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tweak the transition according to the config object.
|
|
||||||
transition.set_duration(duration);
|
|
||||||
transition.set_to(config[property].to);
|
|
||||||
transition.set_from(config[property].from);
|
|
||||||
transition.set_progress_mode(config[property].mode);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// There should always be a scale-y transitions. Once this is finished, we restore the
|
// Once the transitions are finished, we restore the original actor size.
|
||||||
// original actor size.
|
actor.connect('transitions-completed', () => {
|
||||||
const transition = actor.get_transition('scale-y');
|
|
||||||
transition.connect('completed', () => {
|
|
||||||
actor.scale_x = 1.0;
|
actor.scale_x = 1.0;
|
||||||
actor.scale_y = 1.0;
|
actor.scale_y = 1.0;
|
||||||
|
actor.opacity = forOpening ? 1.0 : 0.0;
|
||||||
});
|
});
|
||||||
|
|
||||||
// -------------------------------------------------------------------- add the shader
|
// -------------------------------------------------------------------- add the shader
|
||||||
@@ -434,6 +428,15 @@ class Extension {
|
|||||||
const shader = this._currentEffect.createShader(actor, this._settings, forOpening);
|
const shader = this._currentEffect.createShader(actor, this._settings, forOpening);
|
||||||
|
|
||||||
if (shader) {
|
if (shader) {
|
||||||
|
// There should always be an opacity transition going on...
|
||||||
|
const transition = actor.get_transition('opacity');
|
||||||
|
|
||||||
|
if (!transition) {
|
||||||
|
this._fixAnimationTimes(isDialogWindow, forOpening, null);
|
||||||
|
utils.debug('Cannot setup shader without opacity transition.')
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// First remove any old effect.
|
// First remove any old effect.
|
||||||
actor.remove_effect_by_name(`burn-my-windows-effect`);
|
actor.remove_effect_by_name(`burn-my-windows-effect`);
|
||||||
actor.add_effect_with_name(`burn-my-windows-effect`, shader);
|
actor.add_effect_with_name(`burn-my-windows-effect`, shader);
|
||||||
|
|||||||
Reference in New Issue
Block a user