[gnome-documents] preview: fix fullscreen toolbar and searchbar visibility



commit 2c6d432f5fc2932b167b261a1e4381178f07c0d3
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Tue Jan 15 11:38:38 2013 -0500

    preview: fix fullscreen toolbar and searchbar visibility
    
    Cleanup the code that handles visibility of the fullscreen toolbar
    components, and make "just type" find work in fullscreen as well.

 src/embed.js   |    2 +-
 src/preview.js |   15 +++++++--------
 2 files changed, 8 insertions(+), 9 deletions(-)
---
diff --git a/src/embed.js b/src/embed.js
index 070ed49..b5a371d 100644
--- a/src/embed.js
+++ b/src/embed.js
@@ -453,7 +453,7 @@ const Embed = new Lang.Class({
 
     _onFullscreenChanged: function(controller, fullscreen) {
         Gtk.Settings.get_default().gtk_application_prefer_dark_theme = fullscreen;
-        this._toolbar.widget.visible = !fullscreen;
+        this._toolbar.actor.visible = !fullscreen;
         this._toolbar.widget.sensitive = !fullscreen;
     },
 
diff --git a/src/preview.js b/src/preview.js
index ed11cba..500ef6d 100644
--- a/src/preview.js
+++ b/src/preview.js
@@ -24,6 +24,7 @@ const EvView = imports.gi.EvinceView;
 const GdPrivate = imports.gi.GdPrivate;
 const Gdk = imports.gi.Gdk;
 const Gio = imports.gi.Gio;
+const GLib = imports.gi.GLib;
 const Gtk = imports.gi.Gtk;
 const GtkClutter = imports.gi.GtkClutter;
 const _ = imports.gettext.gettext;
@@ -566,8 +567,6 @@ const PreviewFullscreenToolbar = new Lang.Class({
     _init: function(previewView) {
         this.parent(previewView);
 
-        this.actor.visible = false;
-        this.widget.sensitive = false;
         this.actor.translation_y = -(this.widget.get_preferred_height()[1]);
 
         // make controls show when a toolbar action is activated in fullscreen
@@ -604,7 +603,6 @@ const PreviewFullscreenToolbar = new Lang.Class({
 
     show: function() {
         this.actor.show();
-        this.widget.sensitive = true;
         Tweener.addTween(this.actor,
                          { translation_y: 0,
                            time: 0.20,
@@ -616,11 +614,12 @@ const PreviewFullscreenToolbar = new Lang.Class({
                          { translation_y: -(this.widget.get_preferred_height()[1]),
                            time: 0.20,
                            transition: 'easeOutQuad',
-                           onComplete: function() {
-                               this.actor.hide();
-                               this.widget.sensitive = false;
-                           },
-                           onCompleteScope: this });
+                           onComplete: Lang.bind(this,
+                               function() {
+                                   this.actor.hide();
+                                   Application.application.change_action_state('search', GLib.Variant.new('b', false));
+                               })
+                         });
     }
 });
 Signals.addSignalMethods(PreviewFullscreenToolbar.prototype);



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