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
@ -9,7 +9,7 @@ const Tweener = imports.ui.tweener;
|
||||
const WindowManager = imports.ui.windowManager;
|
||||
const Workspace = imports.ui.workspace;
|
||||
|
||||
var WORKSPACE_SWITCH_TIME = 0.25;
|
||||
var WORKSPACE_SWITCH_TIME = 250;
|
||||
|
||||
var AnimationType = {
|
||||
ZOOM: 0,
|
||||
@ -200,7 +200,7 @@ var WorkspacesView = class extends WorkspacesViewBase {
|
||||
|
||||
if (showAnimation) {
|
||||
let tweenParams = Object.assign(params, {
|
||||
time: WORKSPACE_SWITCH_TIME,
|
||||
time: WORKSPACE_SWITCH_TIME / 1000,
|
||||
transition: 'easeOutQuad'
|
||||
});
|
||||
// we have to call _updateVisibility() once before the
|
||||
@ -247,7 +247,7 @@ var WorkspacesView = class extends WorkspacesViewBase {
|
||||
|
||||
Tweener.addTween(this.scrollAdjustment, {
|
||||
value: index,
|
||||
time: WORKSPACE_SWITCH_TIME,
|
||||
time: WORKSPACE_SWITCH_TIME / 1000,
|
||||
transition: 'easeOutQuad',
|
||||
onComplete: () => {
|
||||
this._animatingScroll = false;
|
||||
|
Reference in New Issue
Block a user