[gnome-shell/gnome-40] environment: Apply autoReverse/repeatCount to all transitions
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gnome-40] environment: Apply autoReverse/repeatCount to all transitions
- Date: Tue, 2 Nov 2021 15:40:02 +0000 (UTC)
commit bb03c23c10e00950b598fb603f568aaaf99ab38a
Author: Florian Müllner <fmuellner gnome org>
Date: Thu Oct 21 19:50:18 2021 +0200
environment: Apply autoReverse/repeatCount to all transitions
Like the old Tweener API, ease() allows to transition multiple
properties at once. If autoReverse or repeatCount are specified,
they should apply to all transitions, but right now we only set
them for the first one.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2007>
(cherry picked from commit cc5cc0d653ccd307475921bf069773d44b34aa5e)
js/ui/environment.js | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/js/ui/environment.js b/js/ui/environment.js
index 29d0849f15..73c755094a 100644
--- a/js/ui/environment.js
+++ b/js/ui/environment.js
@@ -155,20 +155,23 @@ function _easeActor(actor, params) {
actor.set(params);
actor.restore_easing_state();
- let transition = animatedProps.map(p => actor.get_transition(p))
- .find(t => t !== null);
+ const transitions = animatedProps
+ .map(p => actor.get_transition(p))
+ .filter(t => t !== null);
+
+ transitions.forEach(t => t.set({ repeatCount, autoReverse }));
+
+ const [transition] = transitions;
if (transition && transition.delay)
transition.connect('started', () => prepare());
else
prepare();
- if (transition) {
- transition.set({ repeatCount, autoReverse });
+ if (transition)
transition.connect('stopped', (t, finished) => callback(finished));
- } else {
+ else
callback(true);
- }
}
function _easeActorProperty(actor, propName, target, params) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]