viewSelector: make the old page fade-out optional

When leaving the overview, we don't want the old page to fade out, but
we want to fade in the windows directly.

https://bugzilla.gnome.org/show_bug.cgi?id=693974
This commit is contained in:
Cosimo Cecchi 2013-02-16 12:59:54 -05:00
parent 1f1aba4a32
commit 5f3b04ecbd

View File

@ -169,7 +169,7 @@ const ViewSelector = new Lang.Class({
if (!this._workspacesDisplay.activeWorkspaceHasMaximizedWindows()) if (!this._workspacesDisplay.activeWorkspaceHasMaximizedWindows())
Main.overview.fadeOutDesktop(); Main.overview.fadeOutDesktop();
this._showPage(this._workspacesPage); this._showPage(this._workspacesPage, true);
}, },
zoomFromOverview: function() { zoomFromOverview: function() {
@ -205,7 +205,10 @@ const ViewSelector = new Lang.Class({
return page; return page;
}, },
_fadePageIn: function() { _fadePageIn: function(oldPage) {
if (oldPage)
oldPage.hide();
this.emit('page-empty'); this.emit('page-empty');
this._activePage.show(); this._activePage.show();
@ -216,7 +219,7 @@ const ViewSelector = new Lang.Class({
}); });
}, },
_showPage: function(page) { _showPage: function(page, noFade) {
if (page == this._activePage) if (page == this._activePage)
return; return;
@ -224,19 +227,18 @@ const ViewSelector = new Lang.Class({
this._activePage = page; this._activePage = page;
this.emit('page-changed'); this.emit('page-changed');
if (oldPage) if (oldPage && !noFade)
Tweener.addTween(oldPage, Tweener.addTween(oldPage,
{ opacity: 0, { opacity: 0,
time: OverviewControls.SIDE_CONTROLS_ANIMATION_TIME / 2, time: OverviewControls.SIDE_CONTROLS_ANIMATION_TIME / 2,
transition: 'easeOutQuad', transition: 'easeOutQuad',
onComplete: Lang.bind(this, onComplete: Lang.bind(this,
function() { function() {
oldPage.hide(); this._fadePageIn(oldPage);
this._fadePageIn();
}) })
}); });
else else
this._fadePageIn(); this._fadePageIn(oldPage);
}, },
_a11yFocusPage: function(page) { _a11yFocusPage: function(page) {