[gnome-documents] embed: move code to create the GtkClutterEmbed to embed.js
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-documents] embed: move code to create the GtkClutterEmbed to embed.js
- Date: Mon, 2 Jul 2012 06:05:56 +0000 (UTC)
commit d0d8a2d5fb9daa74c3ee4f1dc7fe25ed474e92fa
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Mon Jul 2 02:03:28 2012 -0400
embed: move code to create the GtkClutterEmbed to embed.js
There's a reson it's called Embed after all...
src/embed.js | 8 ++++++++
src/mainWindow.js | 10 +---------
2 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/src/embed.js b/src/embed.js
index 90f622c..e4cc9d0 100644
--- a/src/embed.js
+++ b/src/embed.js
@@ -49,9 +49,17 @@ const Embed = new Lang.Class({
this._loaderCancellable = null;
this._queryErrorId = 0;
+ this.widget = new GtkClutter.Embed();
+ this.widget.show();
+
// the embed is a vertical ClutterBox
+ let stage = this.widget.get_stage();
this._overlayLayout = new Clutter.BinLayout();
this.actor = new Clutter.Box({ layout_manager: this._overlayLayout });
+ this.actor.add_constraint(
+ new Clutter.BindConstraint({ coordinate: Clutter.BindCoordinate.SIZE,
+ source: stage }));
+ stage.add_actor(this.actor);
this._contentsLayout = new Clutter.BoxLayout({ vertical: true });
this._contentsActor = new Clutter.Box({ layout_manager: this._contentsLayout });
diff --git a/src/mainWindow.js b/src/mainWindow.js
index 9cd2e7c..45c8fd5 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -49,11 +49,6 @@ const MainWindow = new Lang.Class({
window_position: Gtk.WindowPosition.CENTER,
hide_titlebar_when_maximized: true,
title: _("Documents") });
- this._clutterEmbed = new GtkClutter.Embed();
- this.window.add(this._clutterEmbed);
- this._clutterEmbed.show();
-
- let stage = this._clutterEmbed.get_stage();
// apply the last saved window size and position
let size = Global.settings.get_value('window-size');
@@ -90,10 +85,7 @@ const MainWindow = new Lang.Class({
Lang.bind(this, this._onFullscreenChanged));
this._embed = new Embed.Embed();
- this._embed.actor.add_constraint(
- new Clutter.BindConstraint({ coordinate: Clutter.BindCoordinate.SIZE,
- source: stage }));
- stage.add_actor(this._embed.actor);
+ this.window.add(this._embed.widget);
},
_saveWindowGeometry: function() {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]