[gnome-shell/wip/re-search-v2: 21/26] overview: hide side controls when searching
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/re-search-v2: 21/26] overview: hide side controls when searching
- Date: Mon, 10 Dec 2012 21:03:44 +0000 (UTC)
commit 09e7ab5611dc79b46afda18dd8bfe40b15c33974
Author: Tanner Doshier <doshitan gmail com>
Date: Fri Aug 10 13:38:33 2012 -0500
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
js/ui/overview.js | 34 ++++++++++++++++++++++++++++++++++
js/ui/viewSelector.js | 5 +++++
2 files changed, 39 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/overview.js b/js/ui/overview.js
index 01df6e9..19bb1c8 100644
--- a/js/ui/overview.js
+++ b/js/ui/overview.js
@@ -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);
},
diff --git a/js/ui/viewSelector.js b/js/ui/viewSelector.js
index 3bc4bbe..2b45f37 100644
--- a/js/ui/viewSelector.js
+++ b/js/ui/viewSelector.js
@@ -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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]