[gnome-documents] evinceview: fix code reacting to actions in fullscreen toolbar



commit 95e251beb0c9be5b91e8628d18caf3de10f47a83
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Sun Oct 23 20:39:17 2016 -0700

    evinceview: fix code reacting to actions in fullscreen toolbar
    
    This needs to connect to the preview action group now.

 src/evinceview.js |   40 +++++++++++++++++-----------------------
 1 files changed, 17 insertions(+), 23 deletions(-)
---
diff --git a/src/evinceview.js b/src/evinceview.js
index 02c890e..2730c57 100644
--- a/src/evinceview.js
+++ b/src/evinceview.js
@@ -121,9 +121,6 @@ const EvinceView = new Lang.Class({
             toolbar = this._fsToolbar.toolbar;
 
         if (action.state.get_boolean()) {
-            if (this.fullscreen)
-                this.controlsVisible = true;
-
             toolbar.searchbar.reveal();
         } else {
             toolbar.searchbar.conceal();
@@ -804,29 +801,26 @@ const EvinceViewFullscreenToolbar = new Lang.Class({
         this.show();
 
         // make controls show when a toolbar action is activated in fullscreen
-        let actionNames = ['gear-menu'];
+        let actionNames = ['gear-menu', 'find'];
         let signalIds = [];
 
-        actionNames.forEach(Lang.bind(this,
-            function(actionName) {
-                let signalName = 'action-state-changed::' + actionName;
-                let signalId = Application.application.connect(signalName, Lang.bind(this,
-                    function(actionGroup, actionName, value) {
-                        let state = value.get_boolean();
-                        if (state)
-                            this.emitJS('show-controls');
-                    }));
-
-                signalIds.push(signalId);
-            }));
+        actionNames.forEach(Lang.bind(this, function(actionName) {
+            let signalName = 'action-state-changed::' + actionName;
+            let signalId = previewView.actionGroup.connect(signalName, Lang.bind(this,
+                function(actionGroup, actionName, value) {
+                    let state = value.get_boolean();
+                    if (state)
+                        this.emitJS('show-controls');
+                }));
 
-        this.toolbar.connect('destroy', Lang.bind(this,
-            function() {
-                signalIds.forEach(
-                    function(signalId) {
-                        Application.application.disconnect(signalId);
-                    });
-            }));
+            signalIds.push(signalId);
+        }));
+
+        this.toolbar.connect('destroy', Lang.bind(this, function() {
+            signalIds.forEach(function(signalId) {
+                previewView.actionGroup.disconnect(signalId);
+            });
+        }));
     },
 
     handleEvent: function(event) {


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