[the-board] [ui] Deactivate any active thing when a toolbox is activated



commit b6cd161c08f8e45da883f9ee4d91133bcf1fb0a4
Author: Lucas Rocha <lucasr gnome org>
Date:   Wed Nov 3 22:32:37 2010 +0000

    [ui] Deactivate any active thing when a toolbox is activated

 src/js/ui/mainWindow.js |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/src/js/ui/mainWindow.js b/src/js/ui/mainWindow.js
index ebc5db2..8750743 100644
--- a/src/js/ui/mainWindow.js
+++ b/src/js/ui/mainWindow.js
@@ -189,6 +189,11 @@ MainWindow.prototype = {
     _createToolBoxGroup : function() {
         this._toolBoxGroup = new ToolBoxGroup.ToolBoxGroup();
 
+        this._toolBoxGroupActiveChangedId =
+            this._toolBoxGroup.connect("active-changed",
+                                       Lang.bind(this,
+                                                 this._onToolBoxGroupActiveChanged));
+
         this._toolBoxGroup.actor.depth = _LAYER_TOOLBOX;
 
         this._createToolBoxPages();
@@ -504,6 +509,12 @@ MainWindow.prototype = {
         clipboard.request_text(onTextReceived, null);
     },
 
+    _onToolBoxGroupActiveChanged : function() {
+        if (this._currentPage && this._toolBoxGroup.active) {
+            this._currentPage.setActiveThing(null);
+        }
+    },
+
     _onClipboardTextReceived : function(clipboard, text, data) {
         if (!text) {
             return;
@@ -692,6 +703,11 @@ MainWindow.prototype = {
             delete this._pageActiveThingChangedId;
         }
 
+        if (this._toolBoxGroupActiveChangedId) {
+            this._currentPage.disconnect(this._toolBoxGroupActiveChangedId);
+            delete this._toolBoxGroupActiveChangedId;
+        }
+
         if (this._pageButtonPressEventId) {
             this._currentPage.disconnect(this._pageButtonPressEventId);
             delete this._pageButtonPressEventId;



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