[gnome-documents] embed: integrate GdFullscreenFilter
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-documents] embed: integrate GdFullscreenFilter
- Date: Mon, 5 Mar 2012 22:23:46 +0000 (UTC)
commit 3bf19432c829536d8fbda2c6768d3c2a2e9771e9
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Mon Mar 5 15:06:20 2012 -0500
embed: integrate GdFullscreenFilter
Instead of listening for motion events on the widgets.
src/embed.js | 18 ++++++++++--------
1 files changed, 10 insertions(+), 8 deletions(-)
---
diff --git a/src/embed.js b/src/embed.js
index e5baa14..613b58c 100644
--- a/src/embed.js
+++ b/src/embed.js
@@ -60,6 +60,9 @@ ViewEmbed.prototype = {
this._scrolledWinView = null;
this._scrolledWinPreview = null;
+ this._filter = new Gd.FullscreenFilter();
+ this._filter.connect('motion-event', Lang.bind(this, this._fullscreenMotionHandler));
+
// the embed is a vertical ClutterBox
this._overlayLayout = new Clutter.BinLayout();
this.actor = new Clutter.Box({ layout_manager: this._overlayLayout });
@@ -170,10 +173,13 @@ ViewEmbed.prototype = {
_onFullscreenChanged: function(controller, fullscreen) {
this._motionTimeoutId = 0;
- if (fullscreen)
+ if (fullscreen) {
this._createFullscreenToolbar();
- else
+ this._filter.start();
+ } else {
+ this._filter.stop();
this._destroyFullscreenToolbar();
+ }
Gtk.Settings.get_default().gtk_application_prefer_dark_theme = fullscreen;
this._toolbar.widget.visible = !fullscreen;
@@ -299,16 +305,14 @@ ViewEmbed.prototype = {
this._toolbar.setModel(this._docModel);
- this._preview.widget.connect('motion-notify-event',
- Lang.bind(this, this._fullscreenMotionHandler));
this._scrolledWinPreview.add(this._preview.widget);
this._preview.widget.grab_focus();
},
- _fullscreenMotionHandler: function(widget, event) {
+ _fullscreenMotionHandler: function() {
if (!Global.modeController.getFullscreen())
- return false;
+ return;
// if we were idle fade in the toolbar, otherwise reset
// the timeout
@@ -327,8 +331,6 @@ ViewEmbed.prototype = {
return false;
}));
-
- return false;
},
_prepareForOverview: function() {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]