[gnome-shell/wip/re-search-v2: 26/33] 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: 26/33] overview: hide side controls when searching
- Date: Mon, 3 Dec 2012 09:57:47 +0000 (UTC)
commit 481709ac978adf22939ff3bde94df8a07e0fe48a
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 | 22 ++++++++++++++++++++++
js/ui/viewSelector.js | 2 ++
2 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/overview.js b/js/ui/overview.js
index 9571e6a..262894f 100644
--- a/js/ui/overview.js
+++ b/js/ui/overview.js
@@ -268,10 +268,32 @@ const Overview = new Lang.Class({
y_fill: true });
this._overview.add_actor(this._messageTrayGhost);
+ this._viewSelector.connect('search-active-changed', Lang.bind(this,
+ function(viewSelector, active) {
+ this._setSideControlsVisibility(!active);
+ }));
+
Main.layoutManager.connect('monitors-changed', Lang.bind(this, this._relayout));
this._relayout();
},
+ _setSideControlsVisibility: function(visible) {
+ // 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;
+
+ if (visible) {
+ this._dash.show();
+ this._thumbnailsBox.show();
+ } else {
+ this._dash.hide();
+ this._thumbnailsBox.hide();
+ }
+ },
+
addSearchProvider: function(provider) {
this._viewSelector.addSearchProvider(provider);
},
diff --git a/js/ui/viewSelector.js b/js/ui/viewSelector.js
index 02e5347..0b95b88 100644
--- a/js/ui/viewSelector.js
+++ b/js/ui/viewSelector.js
@@ -338,6 +338,8 @@ const ViewSelector = new Lang.Class({
this._searchResults.startingSearch();
}
+ this.emit('search-active-changed', this._searchActive);
+
if (this._searchActive) {
this._entry.set_secondary_icon(this._activeIcon);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]