[pitivi: 9/36] Better size handling for image preview



commit d5743c70beaa5651d8dff07f2317785c6bcb80df
Author: Pier Carteri <pier carteri gmail com>
Date:   Sun May 30 16:45:57 2010 +0200

    Better size handling for image preview

 pitivi/ui/filechooserpreview.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/pitivi/ui/filechooserpreview.py b/pitivi/ui/filechooserpreview.py
index 42ffda4..891f088 100644
--- a/pitivi/ui/filechooserpreview.py
+++ b/pitivi/ui/filechooserpreview.py
@@ -163,6 +163,7 @@ class PreviewWidget(gtk.VBox):
                 self.original_dims = (w, h)
                 pixbuf = pixbuf.scale_simple(w, h, gtk.gdk.INTERP_NEAREST)
                 self.preview_image.set_from_pixbuf(pixbuf)
+                self.preview_image.set_size_request(PREVIEW_WIDTH, PREVIEW_HEIGHT)
                 self.preview_image.show()
                 self.bbox.show()
                 self.b_action.set_sensitive(False)
@@ -313,7 +314,10 @@ class PreviewWidget(gtk.VBox):
                     (w, h) = self.original_dims
             pixbuf = gtk.gdk.pixbuf_new_from_file(gst.uri_get_location(self.current_selected_uri))
             pixbuf = pixbuf.scale_simple(int(w), int(h), gtk.gdk.INTERP_BILINEAR)
-            self.preview_image.set_size_request(int(w), int(h))
+            
+            w = max(w, PREVIEW_WIDTH)
+            h = max(h, PREVIEW_HEIGHT)
+            self.preview_image.set_size_request(int(w), int(h))                
             self.preview_image.set_from_pixbuf(pixbuf)
             self.preview_image.show()
 



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