[gnome-shell] tweener: follow org.gnome.desktop.interface enable-animations
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] tweener: follow org.gnome.desktop.interface enable-animations
- Date: Fri, 15 Feb 2013 01:46:31 +0000 (UTC)
commit 5f953510741e67cdd2553b9bf1696412745591d0
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Sat Jan 26 03:41:46 2013 -0500
tweener: follow org.gnome.desktop.interface enable-animations
Disable the animations by making the animation time a very small value.
https://bugzilla.gnome.org/show_bug.cgi?id=655746
js/ui/tweener.js | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/tweener.js b/js/ui/tweener.js
index ecfdb20..65de2d8 100644
--- a/js/ui/tweener.js
+++ b/js/ui/tweener.js
@@ -1,6 +1,7 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const Clutter = imports.gi.Clutter;
+const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
const Lang = imports.lang;
const Mainloop = imports.mainloop;
@@ -44,9 +45,12 @@ const Tweener = imports.tweener.tweener;
// calls any of these is almost certainly wrong anyway, because they
// affect the entire application.)
+let animationSettings = null;
+
// Called from Main.start
function init() {
Tweener.setFrameTicker(new ClutterFrameTicker());
+ animationSettings = new Gio.Settings({ schema: 'org.gnome.desktop.interface' });
}
@@ -73,6 +77,9 @@ function _wrapTweening(target, tweeningParameters) {
}
}
+ if (!animationSettings.get_boolean('enable-animations'))
+ tweeningParameters['time'] = 0.000001;
+
_addHandler(target, tweeningParameters, 'onStart', _tweenStarted);
_addHandler(target, tweeningParameters, 'onComplete', _tweenCompleted);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]