-def real_show_entry(entry, tooltips, grab_focus)
- #- for scoping the actual reference to 'entry'
- gtk_thread_protect(proc {
- msg 3, "using entry #{entry}"
- entry.image = Gtk::Image.new(entry.pixbuf_thumbnail)
- if entry.type == 'video'
- entry.button = Gtk::Button.new.add(Gtk::HBox.new.pack_start(da1 = Gtk::DrawingArea.new.set_size_request($videoborder_pixbuf.width, -1), false, false).
- pack_start(entry.image).
- pack_start(da2 = Gtk::DrawingArea.new.set_size_request($videoborder_pixbuf.width, -1), false, false))
- da1.signal_connect('realize') { da1.window.set_back_pixmap($videoborder_pixmap, false) }
- da2.signal_connect('realize') { da2.window.set_back_pixmap($videoborder_pixmap, false) }
- else
- entry.button = Gtk::Button.new.set_image(entry.image)
+def show_entry(entry, i)
+ #- scope entry
+ msg 3, "showing entry #{entry}"
+ entry.image = Gtk::Image.new(entry.pixbuf_thumbnail)
+ if entry.type == 'video'
+ entry.button = Gtk::Button.new.add(Gtk::HBox.new.pack_start(da1 = Gtk::DrawingArea.new.set_size_request($videoborder_pixbuf.width, -1), false, false).
+ pack_start(entry.image).
+ pack_start(da2 = Gtk::DrawingArea.new.set_size_request($videoborder_pixbuf.width, -1), false, false))
+ da1.signal_connect('realize') { da1.window.set_back_pixmap($videoborder_pixmap, false) }
+ da2.signal_connect('realize') { da2.window.set_back_pixmap($videoborder_pixmap, false) }
+ else
+ entry.button = Gtk::Button.new.set_image(entry.image)
+ end
+ Gtk::Tooltips.new.set_tip(entry.button, entry.get_beautified_name, nil)
+ $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)
+ entry.alignment.set(0.5, 0, 0, 0)
+ sb_msg(_("Selected %s") % entry.get_beautified_name)
+ last_shown and last_shown.alignment.set(0.5, 1, 0, 0)