[cheese/three-point-oh] Added black background to viewport



commit f65c428cdcdd36902cad3670aebcc442e33400da
Author: Yuvaraj Pandian T <yuvipanda gmail com>
Date:   Thu Jul 1 03:40:19 2010 +0530

    Added black background to viewport

 data/cheese-viewport.json |   18 ++++++++++--------
 src/cheese-window.vala    |   13 +++++++++----
 2 files changed, 19 insertions(+), 12 deletions(-)
---
diff --git a/data/cheese-viewport.json b/data/cheese-viewport.json
index 48b3a6d..58c72cf 100644
--- a/data/cheese-viewport.json
+++ b/data/cheese-viewport.json
@@ -2,15 +2,17 @@
 {
     "id": "video_preview",
     "type": "ClutterTexture",
-    "child::x-align": "CLUTTER_BIN_ALIGNMENT_FILL",
-    "child::y-align": "CLUTTER_BIN_ALIGNMENT_FILL"
+    "child::x-align": "CLUTTER_BIN_ALIGNMENT_CENTER",
+    "child::y-align": "CLUTTER_BIN_ALIGNMENT_CENTER"
 },
 {
-    "id": "testy",
-    "type": "ClutterTexture",
-    "child::x-align": "CLUTTER_BIN_ALIGNMENT_FILL",
-    "child::y-align": "CLUTTER_BIN_ALIGNMENT_FILL",
-    "opacity": 128
+    "id": "background",
+    "type": "ClutterRectangle",
+    "color": "Black",
+    "x": 0,
+    "y": 0,
+    "width":768,
+    "height":1024
 },
 {
     "id": "countdown_layer",
@@ -26,8 +28,8 @@
     "type": "ClutterBox",
     "children":
     [
+	'background', 
 	'video_preview',
-	"testy",
 	'countdown_layer'
     ] 
 },
diff --git a/src/cheese-window.vala b/src/cheese-window.vala
index 94e9bf6..ed3d5d2 100644
--- a/src/cheese-window.vala
+++ b/src/cheese-window.vala
@@ -40,6 +40,7 @@ public class Cheese.MainWindow : Gtk.Window
   private Clutter.Texture   video_preview;
   private Clutter.BinLayout viewport_layout_manager;
   private Clutter.Text      countdown_layer;
+  private Clutter.Rectangle background_layer;
 
   private Mx.ScrollView effects_scroller;
   private Mx.Grid effects_grid;
@@ -315,12 +316,13 @@ public class Cheese.MainWindow : Gtk.Window
                                  Clutter.AllocationFlags flags)
   {
     this.viewport_layout.set_size (viewport.width, viewport.height);
+	this.background_layer.set_size (viewport.width, viewport.height);
 	this.effects_scroller.set_size (viewport.width, viewport.height);
-	this.effects_grid.set_size (effects_scroller.width, effects_scroller.height);
+	this.effects_grid.set_size (effects_scroller.width, effects_scroller.height);	
   }
 
-    [CCode (instance_pos = -1)]
-	internal void on_countdown_toggle (ToggleAction action)
+  [CCode (instance_pos = -1)]
+  internal void on_countdown_toggle (ToggleAction action)
   {
     conf.gconf_prop_countdown = action.active;
   }
@@ -534,7 +536,8 @@ public class Cheese.MainWindow : Gtk.Window
     viewport_layout         = (Clutter.Box)clutter_builder.get_object ("viewport_layout");
     viewport_layout_manager = (Clutter.BinLayout)clutter_builder.get_object ("viewport_layout_manager");
     countdown_layer         = (Clutter.Text)clutter_builder.get_object ("countdown_layer");
-
+	background_layer = (Clutter.Rectangle) clutter_builder.get_object ("background");
+	viewport.add_actor (background_layer);
     viewport_layout.set_layout_manager (viewport_layout_manager);
 
     camera = new Camera (video_preview, "/dev/video0", 1024, 768);
@@ -551,6 +554,8 @@ public class Cheese.MainWindow : Gtk.Window
     camera.setup (conf.gconf_prop_camera);
 	camera.play();
 
+
+	
 	camera.toggle_effects_pipeline(false);
 	
     set_wide_mode (conf.gconf_prop_wide_mode, true);



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