[gnome-shell/wip/re-search: 150/151] overview, viewSelector: Don't use two signals for checking the app button



commit 0a8713770b8ab74865e18c82a0f9d7fa0f17e903
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Mon Oct 15 16:36:05 2012 -0400

    overview, viewSelector: Don't use two signals for checking the app button
    
    Just one will do.

 js/ui/overview.js     |   21 ++++++++++-----------
 js/ui/viewSelector.js |    5 +----
 2 files changed, 11 insertions(+), 15 deletions(-)
---
diff --git a/js/ui/overview.js b/js/ui/overview.js
index 6004529..79ee208 100644
--- a/js/ui/overview.js
+++ b/js/ui/overview.js
@@ -261,17 +261,16 @@ const Overview = new Lang.Class({
                     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();
+            function(vs, checked) {
+                this.appsActive = checked;
+                if (checked) {
+                    this._thumbnailsBox.hide();
+                    Main.messageTray.hide();
+                } else {
+                    this._thumbnailsBox.show();
+                    if (this.visible && !this.animationInProgress)
+                        Main.messageTray.show();
+                }
             }));
 
         this.connect('app-drag-begin',
diff --git a/js/ui/viewSelector.js b/js/ui/viewSelector.js
index 82600ef..a5097c5 100644
--- a/js/ui/viewSelector.js
+++ b/js/ui/viewSelector.js
@@ -216,10 +216,7 @@ const ViewSelector = new Lang.Class({
     },
 
     _onShowAppsButtonToggled: function() {
-        if(this._showAppsButton.checked)
-            this.emit('apps-button-checked');
-        else
-            this.emit('apps-button-unchecked');
+        this.emit('apps-button-checked', this._showAppsButton.checked);
 
         if (this.entryNonEmpty)
             this.reset();



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