[cheese/three-point-oh] Keep video preview aspect ratio



commit 51428124f6d8fa7a83863325726946348b5fd618
Author: Filippo Argiolas <filippo argiolas gmail com>
Date:   Thu Jul 15 11:10:31 2010 +0200

    Keep video preview aspect ratio
    
    Turns out it is extremely easy to do this with clutter, just set height
    for with and keep aspect ratio and the layout manager will do the rest.
    Thanks to The Clutter Cookbook.

 src/cheese-window.vala |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/src/cheese-window.vala b/src/cheese-window.vala
index a14390a..c4d8d5a 100644
--- a/src/cheese-window.vala
+++ b/src/cheese-window.vala
@@ -808,6 +808,8 @@ public class Cheese.MainWindow : Gtk.Window
     countdown_layer         = (Clutter.Text)clutter_builder.get_object ("countdown_layer");
     background_layer        = (Clutter.Rectangle)clutter_builder.get_object ("background");
 
+    video_preview.keep_aspect_ratio = true;
+    video_preview.request_mode = Clutter.RequestMode.HEIGHT_FOR_WIDTH;
     viewport.add_actor (background_layer);
     viewport_layout.set_layout_manager (viewport_layout_manager);
 



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