tweener: Use new adjustAnimationTime() helper
Now that we have a new helper function for adjusting animation times, make Tweener use it so that we keep the code in a single place. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/22
This commit is contained in:
parent
ae2af34453
commit
99b4e047dd
@ -3,10 +3,12 @@
|
||||
pauseTweens, resumeTweens, registerSpecialProperty,
|
||||
registerSpecialPropertyModifier, registerSpecialPropertySplitter */
|
||||
|
||||
const { Clutter, GLib, Shell, St } = imports.gi;
|
||||
const { Clutter, GLib, Shell } = imports.gi;
|
||||
const Signals = imports.signals;
|
||||
const Tweener = imports.tweener.tweener;
|
||||
|
||||
const { adjustAnimationTime } = imports.ui.environment;
|
||||
|
||||
// This is a wrapper around imports.tweener.tweener that adds a bit of
|
||||
// Clutter integration. If the tweening target is a Clutter.Actor, then
|
||||
// the tweenings will automatically be removed if the actor is destroyed.
|
||||
@ -50,10 +52,11 @@ function _wrapTweening(target, tweeningParameters) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!St.Settings.get().enable_animations) {
|
||||
tweeningParameters['time'] = 0.000001;
|
||||
tweeningParameters['delay'] = 0.000001;
|
||||
}
|
||||
let { time, delay } = tweeningParameters;
|
||||
if (!isNaN(time))
|
||||
tweeningParameters['time'] = adjustAnimationTime(1000 * time) / 1000;
|
||||
if (!isNaN(delay))
|
||||
tweeningParameters['delay'] = adjustAnimationTime(1000 * delay) / 1000;
|
||||
|
||||
_addHandler(target, tweeningParameters, 'onComplete', _tweenCompleted);
|
||||
}
|
||||
@ -211,9 +214,6 @@ var ClutterFrameTicker = class {
|
||||
}
|
||||
|
||||
start() {
|
||||
let settings = St.Settings.get();
|
||||
if (settings.slow_down_factor > 0)
|
||||
Tweener.setTimeScale(1 / settings.slow_down_factor);
|
||||
this._timeline.start();
|
||||
global.begin_work();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user