overviewControls: Don't allow appearing controls to "pop in"

When coming back from search or apps, the workspace thumbnails and dash
don't slide in but "pop in". This is because of bad timing: when slideIn
is called, we immediately start the translation animation, and it
completes before by the time we fade the new page in.

Fix this by calling slideIn and slideOut at two different times: we now
slide out when the old page with our controls is fading out, and slide in
when the new page with our controls is fading in.

https://bugzilla.gnome.org/show_bug.cgi?id=708340
This commit is contained in:
Jasper St. Pierre 2013-09-18 20:17:32 -04:00
parent fb561f10a7
commit e31693bbee

View File

@ -208,23 +208,12 @@ const SlidingControl = new Lang.Class({
slideIn: function() { slideIn: function() {
this.visible = true; this.visible = true;
this._updateTranslation(); this._updateTranslation();
// we will update slideX and the translation from pageEmpty
}, },
slideOut: function() { slideOut: function() {
this.visible = false; this.visible = false;
this._updateTranslation(); this._updateTranslation();
// we will update slideX from pageEmpty
}, },
pageEmpty: function() {
// When pageEmpty is received, there's no visible view in the
// selector; this means we can now safely set the full slide for
// the next page, since slideIn or slideOut might have been called,
// changing the visiblity
this.layout.slideX = this.getSlide();
this._updateTranslation();
}
}); });
const ThumbnailsSlider = new Lang.Class({ const ThumbnailsSlider = new Lang.Class({
@ -600,18 +589,14 @@ const ControlsManager = new Lang.Class({
return; return;
let activePage = this.viewSelector.getActivePage(); let activePage = this.viewSelector.getActivePage();
let dashVisible = (activePage == ViewSelector.ViewPage.WINDOWS || let dashVisible = (activePage == ViewSelector.ViewPage.WINDOWS ||
activePage == ViewSelector.ViewPage.APPS); activePage == ViewSelector.ViewPage.APPS);
let thumbnailsVisible = (activePage == ViewSelector.ViewPage.WINDOWS); if (!dashVisible)
if (dashVisible)
this._dashSlider.slideIn();
else
this._dashSlider.slideOut(); this._dashSlider.slideOut();
if (thumbnailsVisible) let thumbnailsVisible = (activePage == ViewSelector.ViewPage.WINDOWS);
this._thumbnailsSlider.slideIn(); if (!thumbnailsVisible)
else
this._thumbnailsSlider.slideOut(); this._thumbnailsSlider.slideOut();
}, },
@ -624,8 +609,16 @@ const ControlsManager = new Lang.Class({
}, },
_onPageEmpty: function() { _onPageEmpty: function() {
this._dashSlider.pageEmpty(); let activePage = this.viewSelector.getActivePage();
this._thumbnailsSlider.pageEmpty();
let dashVisible = (activePage == ViewSelector.ViewPage.WINDOWS ||
activePage == ViewSelector.ViewPage.APPS);
if (dashVisible)
this._dashSlider.slideIn();
let thumbnailsVisible = (activePage == ViewSelector.ViewPage.WINDOWS);
if (thumbnailsVisible)
this._thumbnailsSlider.slideIn();
this._updateSpacerVisibility(); this._updateSpacerVisibility();
} }