[gnome-shell/wip/fmuellner/ease-actors: 1048/1052] environment: Add adjustAnimationTime() helper
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/fmuellner/ease-actors: 1048/1052] environment: Add adjustAnimationTime() helper
- Date: Tue, 6 Aug 2019 02:18:04 +0000 (UTC)
commit f782857d1caf030bbf3b8ef18e4070da6c159eaf
Author: Florian Müllner <fmuellner gnome org>
Date: Thu Jun 5 00:13:14 2014 +0200
environment: Add adjustAnimationTime() helper
As we currently use Tweener for all animations, we have a single place
for hooking up the enable-animations and slow-down-factor settings.
However that will no longer hold true when we'll start to use Clutter's
built-in animation facilities, so add a small helper function that
applies the necessary adjustments.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/22
js/ui/environment.js | 14 ++++++++++++++
1 file changed, 14 insertions(+)
---
diff --git a/js/ui/environment.js b/js/ui/environment.js
index ce0c875fe..55d10198e 100644
--- a/js/ui/environment.js
+++ b/js/ui/environment.js
@@ -145,3 +145,17 @@ function init() {
Tweener.init();
String.prototype.format = Format.format;
}
+
+// adjustAnimationTime:
+// @msecs: time in milliseconds
+//
+// Adjust @msecs to account for St's enable-animations
+// and slow-down-factor settings
+function adjustAnimationTime(msecs) {
+ let settings = St.Settings.get();
+
+ if (!settings.enable_animations)
+ return 1;
+ return settings.slow_down_factor * msecs;
+}
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]