put a visual on the borders of videos - this time I managed to do it ;p
authorgc <gc>
Sun, 29 Jan 2006 16:31:40 +0000 (16:31 +0000)
committergc <gc>
Sun, 29 Jan 2006 16:31:40 +0000 (16:31 +0000)
bin/booh
data/booh/images/video_border.png [new file with mode: 0644]

index 5b68c68..4a8b8c8 100755 (executable)
--- a/bin/booh
+++ b/bin/booh
@@ -936,13 +936,25 @@ def add_thumbnail(autotable, filename, type, thumbnail_img, caption)
         gen_real_thumbnail('element', fullpath, thumbnail_img, $xmldir, $default_size['thumbnails'], img, '')
     }
 
+    if type == 'video'
+        pxb = Gdk::Pixbuf.new("#{$FPATH}/images/video_border.png")
+        frame1.add(Gtk::HBox.new.pack_start(da1 = Gtk::DrawingArea.new.set_size_request(pxb.width, -1), false, false).
+                                 pack_start(img = Gtk::Image.new).
+                                 pack_start(da2 = Gtk::DrawingArea.new.set_size_request(pxb.width, -1), false, false))
+        px, mask = pxb.render_pixmap_and_mask
+        da1.signal_connect('realize') { da1.window.set_back_pixmap(px, false) }
+        da2.signal_connect('realize') { da2.window.set_back_pixmap(px, false) }
+    else
+        frame1.add(img = Gtk::Image.new)
+    end
+
     #- generate the thumbnail if missing (if image was rotated but booh was not relaunched)
     if !$modified_pixbufs[thumbnail_img] && !File.exists?(thumbnail_img)
-        frame1.add(img = Gtk::Image.new)
         my_gen_real_thumbnail.call
     else
-        frame1.add(img = Gtk::Image.new($modified_pixbufs[thumbnail_img] ? $modified_pixbufs[thumbnail_img][:pixbuf] : thumbnail_img))
+        img.set($modified_pixbufs[thumbnail_img] ? $modified_pixbufs[thumbnail_img][:pixbuf] : thumbnail_img)
     end
+
     evtbox = Gtk::EventBox.new.add(Gtk::Alignment.new(0.5, 0.5, 0, 0).add(frame1.set_shadow_type(Gtk::SHADOW_ETCHED_OUT)))
 
     tooltips = Gtk::Tooltips.new
diff --git a/data/booh/images/video_border.png b/data/booh/images/video_border.png
new file mode 100644 (file)
index 0000000..e893b1c
Binary files /dev/null and b/data/booh/images/video_border.png differ