[gnome-shell/wip/re-search: 48/48] overview, viewSelector: show/hide workspaces and message tray on apps button



commit 2f86338660c9f3be707f0923f70f043e62fff717
Author: Tanner Doshier <doshitan gmail com>
Date:   Wed Oct 10 22:17:41 2012 -0500

    overview, viewSelector: show/hide workspaces and message tray on apps button

 js/ui/overview.js     |   18 ++++++++++++++++++
 js/ui/viewSelector.js |    5 +++++
 2 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/overview.js b/js/ui/overview.js
index 23dad54..22ace19 100644
--- a/js/ui/overview.js
+++ b/js/ui/overview.js
@@ -138,6 +138,7 @@ const Overview = new Lang.Class({
         this.animationInProgress = false;
         this._hideInProgress = false;
         this.searchActive = false;
+        this.appsActive = false;
 
         // During transitions, we raise this to the top to avoid having the overview
         // area be reactive; it causes too many issues such as double clicks on
@@ -255,6 +256,19 @@ const Overview = new Lang.Class({
                 if (this.visible && !this.animationInProgress)
                     Main.messageTray.show();
             }));
+        this._viewSelector.connect('apps-button-checked', Lang.bind(this,
+            function() {
+                this.appsActive = true;
+                this._thumbnailsBox.hide();
+                Main.messageTray.hide();
+            }));
+        this._viewSelector.connect('apps-button-unchecked', Lang.bind(this,
+            function() {
+                this.appsActive = false;
+                this._thumbnailsBox.show();
+                if (this.visible && !this.animationInProgress)
+                    Main.messageTray.show();
+            }));
 
         this.connect('app-drag-begin',
                               Lang.bind(this, function () {
@@ -266,6 +280,8 @@ const Overview = new Lang.Class({
                                   if (this.searchActive) {
                                       this._dash.hide();
                                       this._thumbnailsBox.hide();
+                                  } else if (this.appsActive) {
+                                      this._thumbnailsBox.hide();
                                   }
                               }));
         this.connect('app-drag-end',
@@ -273,6 +289,8 @@ const Overview = new Lang.Class({
                                   if (this.searchActive) {
                                       this._dash.hide();
                                       this._thumbnailsBox.hide();
+                                  } else if (this.appsActive) {
+                                      this._thumbnailsBox.hide();
                                   }
                               }));
 
diff --git a/js/ui/viewSelector.js b/js/ui/viewSelector.js
index 19228f5..a5125fb 100644
--- a/js/ui/viewSelector.js
+++ b/js/ui/viewSelector.js
@@ -204,6 +204,11 @@ const ViewSelector = new Lang.Class({
     },
 
     _onShowAppsButtonToggled: function() {
+        if(this._showAppsButton.checked)
+            this.emit('apps-button-checked');
+        else
+            this.emit('apps-button-unchecked');
+
         if (this.entryNonEmpty)
             this.reset();
         else



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