diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index 16f3aa635..471a65c85 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -17,7 +17,9 @@ const AppFavorites = imports.ui.appFavorites; const DND = imports.ui.dnd; const GenericDisplay = imports.ui.genericDisplay; const Main = imports.ui.main; +const Overview = imports.ui.overview; const Search = imports.ui.search; +const Tweener = imports.ui.tweener; const Workspace = imports.ui.workspace; const APPICON_SIZE = 48; @@ -179,9 +181,28 @@ AllAppDisplay.prototype = { }, toggle: function() { - this.emit('open-state-changed', !this.actor.visible); - - this.actor.visible = !this.actor.visible; + if (this.actor.visible) { + Tweener.addTween(this.actor, + { opacity: 0, + time: Overview.PANE_FADE_TIME, + transition: 'easeOutQuad', + onComplete: Lang.bind(this, + function() { + this.actor.hide(); + this.emit('open-state-changed', + this.actor.visible); + }) + }); + } else { + this.actor.show(); + this.emit('open-state-changed', this.actor.visible); + this.actor.opacity = 0; + Tweener.addTween(this.actor, + { opacity: 255, + time: Overview.PANE_FADE_TIME, + transition: 'easeOutQuad' + }); + } }, close: function() { diff --git a/js/ui/dash.js b/js/ui/dash.js index e944f90d6..df0cc4beb 100644 --- a/js/ui/dash.js +++ b/js/ui/dash.js @@ -17,7 +17,9 @@ const DocDisplay = imports.ui.docDisplay; const PlaceDisplay = imports.ui.placeDisplay; const GenericDisplay = imports.ui.genericDisplay; const Main = imports.ui.main; +const Overview = imports.ui.overview; const Search = imports.ui.search; +const Tweener = imports.ui.tweener; // 25 search results (per result type) should be enough for everyone const MAX_RENDERED_SEARCH_RESULTS = 25; @@ -79,16 +81,29 @@ Pane.prototype = { if (this._open) return; this._open = true; - this.actor.show(); this.emit('open-state-changed', this._open); + this.actor.opacity = 0; + this.actor.show(); + Tweener.addTween(this.actor, + { opacity: 255, + time: Overview.PANE_FADE_TIME, + transition: 'easeOutQuad' + }); }, close: function () { if (!this._open) return; this._open = false; - this.actor.hide(); - this.emit('open-state-changed', this._open); + Tweener.addTween(this.actor, + { opacity: 0, + time: Overview.PANE_FADE_TIME, + transition: 'easeOutQuad', + onComplete: Lang.bind(this, function() { + this.actor.hide(); + this.emit('open-state-changed', this._open); + }) + }); }, destroyContent: function() { diff --git a/js/ui/overview.js b/js/ui/overview.js index 228031c22..10826963d 100644 --- a/js/ui/overview.js +++ b/js/ui/overview.js @@ -24,6 +24,9 @@ const WorkspacesView = imports.ui.workspacesView; // Time for initial animation going into Overview mode const ANIMATION_TIME = 0.25; +// Time for pane menus to fade in/out +const PANE_FADE_TIME = 0.1; + // We divide the screen into a grid of rows and columns, which we use // to help us position the Overview components, such as the side panel // that lists applications and documents, the workspaces display, and