cleanup: Use milliseconds for animation times
The different units - seconds for Tweener and milliseconds for timeouts - are not a big issue currently, as there is little overlap. However this will change when we start using Clutter's own animation framework (which uses milliseconds as well), in particular where constants are shared between modules. In order to prepare for the transition, define all animation times as milliseconds and adjust them when passing them to Tweener. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/663
This commit is contained in:

committed by
Georges Basile Stavracas Neto

parent
31968ea53c
commit
476816732f
@@ -22,15 +22,15 @@ const SwitchMonitor = imports.ui.switchMonitor;
|
||||
const { loadInterfaceXML } = imports.misc.fileUtils;
|
||||
|
||||
var SHELL_KEYBINDINGS_SCHEMA = 'org.gnome.shell.keybindings';
|
||||
var MINIMIZE_WINDOW_ANIMATION_TIME = 0.2;
|
||||
var SHOW_WINDOW_ANIMATION_TIME = 0.15;
|
||||
var DIALOG_SHOW_WINDOW_ANIMATION_TIME = 0.1;
|
||||
var DESTROY_WINDOW_ANIMATION_TIME = 0.15;
|
||||
var DIALOG_DESTROY_WINDOW_ANIMATION_TIME = 0.1;
|
||||
var WINDOW_ANIMATION_TIME = 0.25;
|
||||
var MINIMIZE_WINDOW_ANIMATION_TIME = 200;
|
||||
var SHOW_WINDOW_ANIMATION_TIME = 150;
|
||||
var DIALOG_SHOW_WINDOW_ANIMATION_TIME = 100;
|
||||
var DESTROY_WINDOW_ANIMATION_TIME = 150;
|
||||
var DIALOG_DESTROY_WINDOW_ANIMATION_TIME = 100;
|
||||
var WINDOW_ANIMATION_TIME = 250;
|
||||
var DIM_BRIGHTNESS = -0.3;
|
||||
var DIM_TIME = 0.500;
|
||||
var UNDIM_TIME = 0.250;
|
||||
var DIM_TIME = 500;
|
||||
var UNDIM_TIME = 250;
|
||||
var MOTION_THRESHOLD = 100;
|
||||
|
||||
var ONE_SECOND = 1000; // in ms
|
||||
@@ -419,7 +419,7 @@ var TilePreview = class {
|
||||
width: tileRect.width,
|
||||
height: tileRect.height,
|
||||
opacity: 255,
|
||||
time: WINDOW_ANIMATION_TIME,
|
||||
time: WINDOW_ANIMATION_TIME / 1000,
|
||||
transition: 'easeOutQuad'
|
||||
});
|
||||
}
|
||||
@@ -431,7 +431,7 @@ var TilePreview = class {
|
||||
this._showing = false;
|
||||
Tweener.addTween(this.actor,
|
||||
{ opacity: 0,
|
||||
time: WINDOW_ANIMATION_TIME,
|
||||
time: WINDOW_ANIMATION_TIME / 1000,
|
||||
transition: 'easeOutQuad',
|
||||
onComplete: this._reset.bind(this)
|
||||
});
|
||||
@@ -1139,7 +1139,7 @@ var WindowManager = class {
|
||||
Tweener.addTween(switchData.container,
|
||||
{ x: 0,
|
||||
y: 0,
|
||||
time: WINDOW_ANIMATION_TIME,
|
||||
time: WINDOW_ANIMATION_TIME / 1000,
|
||||
transition: 'easeOutQuad',
|
||||
onComplete: this._finishWorkspaceSwitch,
|
||||
onCompleteScope: this,
|
||||
@@ -1284,7 +1284,7 @@ var WindowManager = class {
|
||||
if (actor.meta_window.is_monitor_sized()) {
|
||||
Tweener.addTween(actor,
|
||||
{ opacity: 0,
|
||||
time: MINIMIZE_WINDOW_ANIMATION_TIME,
|
||||
time: MINIMIZE_WINDOW_ANIMATION_TIME / 1000,
|
||||
transition: 'easeOutQuad',
|
||||
onComplete: this._minimizeWindowDone,
|
||||
onCompleteScope: this,
|
||||
@@ -1320,7 +1320,7 @@ var WindowManager = class {
|
||||
scale_y: yScale,
|
||||
x: xDest,
|
||||
y: yDest,
|
||||
time: MINIMIZE_WINDOW_ANIMATION_TIME,
|
||||
time: MINIMIZE_WINDOW_ANIMATION_TIME / 1000,
|
||||
transition: 'easeInExpo',
|
||||
onComplete: this._minimizeWindowDone,
|
||||
onCompleteScope: this,
|
||||
@@ -1365,7 +1365,7 @@ var WindowManager = class {
|
||||
actor.set_scale(1.0, 1.0);
|
||||
Tweener.addTween(actor,
|
||||
{ opacity: 255,
|
||||
time: MINIMIZE_WINDOW_ANIMATION_TIME,
|
||||
time: MINIMIZE_WINDOW_ANIMATION_TIME / 1000,
|
||||
transition: 'easeOutQuad',
|
||||
onComplete: this._unminimizeWindowDone,
|
||||
onCompleteScope: this,
|
||||
@@ -1402,7 +1402,7 @@ var WindowManager = class {
|
||||
scale_y: 1.0,
|
||||
x: xDest,
|
||||
y: yDest,
|
||||
time: MINIMIZE_WINDOW_ANIMATION_TIME,
|
||||
time: MINIMIZE_WINDOW_ANIMATION_TIME / 1000,
|
||||
transition: 'easeInExpo',
|
||||
onComplete: this._unminimizeWindowDone,
|
||||
onCompleteScope: this,
|
||||
@@ -1488,7 +1488,7 @@ var WindowManager = class {
|
||||
scale_x: scaleX,
|
||||
scale_y: scaleY,
|
||||
opacity: 0,
|
||||
time: WINDOW_ANIMATION_TIME,
|
||||
time: WINDOW_ANIMATION_TIME / 1000,
|
||||
transition: 'easeOutQuad'
|
||||
});
|
||||
|
||||
@@ -1505,7 +1505,7 @@ var WindowManager = class {
|
||||
scale_y: 1.0,
|
||||
translation_x: 0,
|
||||
translation_y: 0,
|
||||
time: WINDOW_ANIMATION_TIME,
|
||||
time: WINDOW_ANIMATION_TIME / 1000,
|
||||
transition: 'easeOutQuad',
|
||||
onComplete: this._sizeChangeWindowDone,
|
||||
onCompleteScope: this,
|
||||
@@ -1586,7 +1586,7 @@ var WindowManager = class {
|
||||
if (this._shouldAnimate())
|
||||
Tweener.addTween(dimmer,
|
||||
{ dimFactor: 1.0,
|
||||
time: DIM_TIME,
|
||||
time: DIM_TIME / 1000,
|
||||
transition: 'linear'
|
||||
});
|
||||
else
|
||||
@@ -1603,7 +1603,7 @@ var WindowManager = class {
|
||||
if (this._shouldAnimate())
|
||||
Tweener.addTween(dimmer,
|
||||
{ dimFactor: 0.0,
|
||||
time: UNDIM_TIME,
|
||||
time: UNDIM_TIME / 1000,
|
||||
transition: 'linear' });
|
||||
else
|
||||
dimmer.dimFactor = 0.0;
|
||||
@@ -1655,7 +1655,7 @@ var WindowManager = class {
|
||||
{ opacity: 255,
|
||||
scale_x: 1,
|
||||
scale_y: 1,
|
||||
time: SHOW_WINDOW_ANIMATION_TIME,
|
||||
time: SHOW_WINDOW_ANIMATION_TIME / 1000,
|
||||
transition: 'easeOutExpo',
|
||||
onComplete: this._mapWindowDone,
|
||||
onCompleteScope: this,
|
||||
@@ -1677,7 +1677,7 @@ var WindowManager = class {
|
||||
{ opacity: 255,
|
||||
scale_x: 1,
|
||||
scale_y: 1,
|
||||
time: DIALOG_SHOW_WINDOW_ANIMATION_TIME,
|
||||
time: DIALOG_SHOW_WINDOW_ANIMATION_TIME / 1000,
|
||||
transition: 'easeOutQuad',
|
||||
onComplete: this._mapWindowDone,
|
||||
onCompleteScope: this,
|
||||
@@ -1743,7 +1743,7 @@ var WindowManager = class {
|
||||
{ opacity: 0,
|
||||
scale_x: 0.8,
|
||||
scale_y: 0.8,
|
||||
time: DESTROY_WINDOW_ANIMATION_TIME,
|
||||
time: DESTROY_WINDOW_ANIMATION_TIME / 1000,
|
||||
transition: 'easeOutQuad',
|
||||
onComplete: this._destroyWindowDone,
|
||||
onCompleteScope: this,
|
||||
@@ -1768,7 +1768,7 @@ var WindowManager = class {
|
||||
|
||||
Tweener.addTween(actor,
|
||||
{ scale_y: 0,
|
||||
time: DIALOG_DESTROY_WINDOW_ANIMATION_TIME,
|
||||
time: DIALOG_DESTROY_WINDOW_ANIMATION_TIME / 1000,
|
||||
transition: 'easeOutQuad',
|
||||
onComplete: this._destroyWindowDone,
|
||||
onCompleteScope: this,
|
||||
@@ -2017,7 +2017,7 @@ var WindowManager = class {
|
||||
Tweener.addTween(this._switchData.container,
|
||||
{ x: xDest,
|
||||
y: yDest,
|
||||
time: WINDOW_ANIMATION_TIME,
|
||||
time: WINDOW_ANIMATION_TIME / 1000,
|
||||
transition: 'easeOutQuad',
|
||||
onComplete: this._switchWorkspaceDone,
|
||||
onCompleteScope: this,
|
||||
|
Reference in New Issue
Block a user