odie's idea: move currently selection thumbnail up instead of using an arrow
authorgc <gc>
Wed, 25 Jul 2007 18:46:14 +0000 (18:46 +0000)
committergc <gc>
Wed, 25 Jul 2007 18:46:14 +0000 (18:46 +0000)
bin/booh-classifier
data/booh/images/arrow_towards_up.png [deleted file]

index c9aad3f..d1dc715 100644 (file)
@@ -231,7 +231,7 @@ class Entry
         return @@thumbnails_height
     end
 
-    attr_accessor :path, :type, :angle, :button, :image, :selection_materializer, :removed, :labeled
+    attr_accessor :path, :type, :angle, :button, :image, :alignment, :removed, :labeled
 
     def initialize(path, type)
         @path = path
@@ -836,23 +836,17 @@ def real_show_entry(entry, tooltips, grab_focus)
             entry.button = Gtk::Button.new.set_image(entry.image)
         end
         tooltips.set_tip(entry.button, basepath = File.basename(entry.path).gsub(/\.[^.]+$/, ''), nil)
-        entry.selection_materializer = Gtk::DrawingArea.new.set_size_request($selection_materializer_pixbuf.width, $selection_materializer_pixbuf.height)
-        selection_materializer_drawer = proc {
-            entry.selection_materializer.window.draw_pixbuf(nil, $selection_materializer_pixbuf, 0, 0, 0, 0, -1, -1, Gdk::RGB::DITHER_NONE, -1, -1)
-        }
-        $imagesline.pack_start(Gtk::VBox.new(false, 0).pack_start(entry.button, false, false).
-                                                       pack_start(Gtk::Alignment.new(0.5, 0.5, 0, 0).add(entry.selection_materializer), false, false).show_all, false, false)
+        $imagesline.pack_start(entry.alignment = Gtk::Alignment.new(0.5, 1, 0, 0).add(entry.button).show_all, false, false)
         entry.button.signal_connect('clicked') {
             if (last_shown = $mainview.get_shown_entry) != entry
                 $mainview.set_shown_entry(entry)
-                selection_materializer_drawer.call
+                entry.alignment.set(0.5, 0, 0, 0)
                 sb_msg(_("Selected %s") % basepath)
-                last_shown.nil? or last_shown.selection_materializer.window.clear
+                last_shown.nil? or last_shown.alignment.set(0.5, 1, 0, 0)
             end
         }
         entry.button.signal_connect('focus-in-event') { entry.button.clicked; autoscroll_if_needed(entry.button) }
         entry.button.signal_connect('key-press-event') { |w, e| thumbnail_keypressed(entry, e) }
-        entry.selection_materializer.signal_connect('expose-event') { $mainview.get_shown_entry == entry and selection_materializer_drawer.call }
         if grab_focus
             entry.button.grab_focus
         end
@@ -1350,8 +1344,6 @@ def create_main_window
     $videoborder_pixbuf = Gdk::Pixbuf.new("#{$FPATH}/images/video_border.png")
     $videoborder_pixmap, = $videoborder_pixbuf.render_pixmap_and_mask(0)
 
-    $selection_materializer_pixbuf = Gdk::Pixbuf.new("#{$FPATH}/images/arrow_towards_up.png")
-
     mb = create_menubar
 
     main_vbox = Gtk::VBox.new(false, 0)
@@ -1367,7 +1359,7 @@ def create_main_window
     main_vbox.pack_start($imagesline_sw, false, false)
     main_vbox.pack_end($statusbar = Gtk::Statusbar.new, false, false)
 
-    $imagesline.set_size_request(-1, Gtk::Button.new.size_request[1] + Entry.thumbnails_height + $selection_materializer_pixbuf.height)
+    $imagesline.set_size_request(-1, Gtk::Button.new.size_request[1] + Entry.thumbnails_height + 10)
 
     $main_window = Gtk::Window.new
     $main_window.add(main_vbox)
diff --git a/data/booh/images/arrow_towards_up.png b/data/booh/images/arrow_towards_up.png
deleted file mode 100644 (file)
index a97dcbe..0000000
Binary files a/data/booh/images/arrow_towards_up.png and /dev/null differ