From 2ca1fe3254312935cdf7870e792d5b53c666fc0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sun, 9 May 2010 02:09:17 +0200 Subject: [PATCH] [workspacesView] Animate showing/hiding of controls Some of the workspace view controls are hidden when the number of workspaces is one (view toggle button, scroll bar in single view). Use a fade effect instead of showing/hiding the control abruptly. https://bugzilla.gnome.org/show_bug.cgi?id=613456 --- js/ui/workspacesView.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js index 3d3519d22..99f080552 100644 --- a/js/ui/workspacesView.js +++ b/js/ui/workspacesView.js @@ -1373,10 +1373,10 @@ SingleView.prototype = { _updatePanelVisibility: function() { let showSwitches = (global.screen.n_workspaces > 1); if (this._scroll != null) { - if (showSwitches) - this._scroll.show(); - else - this._scroll.hide(); + Tweener.addTween(this._scroll, + { opacity: showSwitches ? 255 : 0, + time: WORKSPACE_SWITCH_TIME, + transition: 'easeOutQuad' }); } }, @@ -1531,10 +1531,11 @@ WorkspacesControls.prototype = { }, _workspacesChanged: function() { - if (global.screen.n_workspaces == 1) - this._toggleViewButton.hide(); - else - this._toggleViewButton.show(); + let showToggleButton = (global.screen.n_workspaces > 1) + Tweener.addTween(this._toggleViewButton, + { opacity: showToggleButton ? 255 : 0, + time: WORKSPACE_SWITCH_TIME, + transition: 'easeOutQuad' }); this.updateControlsSensitivity(); } };