[gnome-shell/wip/re-search: 143/151] viewSelector, overview: Add search signals and connect them to hide/show



commit 4b0ba8b7b8ba49e96f3084efac4d91eeb5047b08
Author: Tanner Doshier <doshitan gmail com>
Date:   Fri Aug 10 13:38:33 2012 -0500

    viewSelector, overview: Add search signals and connect them to hide/show
    
    Hide the elements when the search entry is non-empty. Show them if the search
    is cancelled.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=682050

 js/ui/overview.js     |   11 +++++++++++
 js/ui/viewSelector.js |    2 ++
 2 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/overview.js b/js/ui/overview.js
index 16fbcc8..e645516 100644
--- a/js/ui/overview.js
+++ b/js/ui/overview.js
@@ -238,6 +238,17 @@ const Overview = new Lang.Class({
                                               opacity: 0 });
         this._overview.add_actor(this._messageTrayGhost);
 
+        this._viewSelector.connect('search-begin', Lang.bind(this,
+            function() {
+                this._dash.hide();
+                this._thumbnailsBox.hide();
+            }));
+        this._viewSelector.connect('search-cancelled', Lang.bind(this,
+            function() {
+                this._dash.show();
+                this._thumbnailsBox.show();
+            }));
+
         Main.layoutManager.connect('monitors-changed', Lang.bind(this, this._relayout));
         this._relayout();
     },
diff --git a/js/ui/viewSelector.js b/js/ui/viewSelector.js
index 44c01a9..d2cdb57 100644
--- a/js/ui/viewSelector.js
+++ b/js/ui/viewSelector.js
@@ -258,6 +258,7 @@ const ViewSelector = new Lang.Class({
     },
 
     _searchCancelled: function() {
+        this.emit('search-cancelled');
         this._showPage(this._showAppsButton.checked ? this._appsPage
                                                     : this._workspacesPage);
 
@@ -326,6 +327,7 @@ const ViewSelector = new Lang.Class({
             this._searchResults.startingSearch();
         }
         if (this.active) {
+            this.emit('search-begin');
             this._entry.set_secondary_icon(this._activeIcon);
 
             if (this._iconClickedId == 0) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]