overview: hide side controls when searching

Hide the elements when the search is active. Show them if the search
is cancelled.

https://bugzilla.gnome.org/show_bug.cgi?id=682050
This commit is contained in:
Tanner Doshier 2012-08-10 13:38:33 -05:00 committed by Cosimo Cecchi
parent 53cff07eef
commit 09e7ab5611
2 changed files with 39 additions and 0 deletions

View File

@ -268,10 +268,44 @@ const Overview = new Lang.Class({
y_fill: true });
this._overview.add_actor(this._messageTrayGhost);
this._viewSelector.connect('page-changed', Lang.bind(this,
function() {
this._setSideControlsVisibility();
}));
Main.layoutManager.connect('monitors-changed', Lang.bind(this, this._relayout));
this._relayout();
},
_setSideControlsVisibility: function() {
// Ignore the case when we're leaving the overview, since
// actors will be made visible again when entering the overview
// next time, and animating them while doing so is just
// unnecesary noise
if (!this.visible || this.animationInProgress)
return;
let searchActive = this._viewSelector.getSearchActive();
let dashVisible = !searchActive;
let thumbnailsVisible = !searchActive;
let trayVisible = !searchActive;
if (dashVisible)
this._dash.show();
else
this._dash.hide();
if (thumbnailsVisible)
this._thumbnailsBox.show();
else
this._thumbnailsBox.hide();
if (trayVisible)
Main.messageTray.show();
else
Main.messageTray.hide();
},
addSearchProvider: function(provider) {
this._viewSelector.addSearchProvider(provider);
},

View File

@ -207,6 +207,7 @@ const ViewSelector = new Lang.Class({
function() {
this._activePage.hide();
this._activePage = page;
this.emit('page-changed');
})
});
}
@ -468,6 +469,10 @@ const ViewSelector = new Lang.Class({
removeSearchProvider: function(provider) {
this._searchSystem.unregisterProvider(provider);
this._searchResults.destroyProviderMeta(provider);
},
getSearchActive: function() {
return this._searchActive;
}
});
Signals.addSignalMethods(ViewSelector.prototype);