[epiphany/overview: 22/31] gd-main-icon-view: use the new renderer to add a close button to items



commit 3981530c262217d2434dd31e116fe49adea7143a
Author: Claudio Saavedra <csaavedra igalia com>
Date:   Fri May 25 10:54:16 2012 +0200

    gd-main-icon-view: use the new renderer to add a close button to items
    
    Also, emit the GdMainViewGeneric:delete-item-clicked when the button
    is clicked. The signal is still unhandled, so clicking in the button
    will not make any difference yet.

 lib/widgets/gd-main-icon-view.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/lib/widgets/gd-main-icon-view.c b/lib/widgets/gd-main-icon-view.c
index 4cc14c6..1f258f2 100644
--- a/lib/widgets/gd-main-icon-view.c
+++ b/lib/widgets/gd-main-icon-view.c
@@ -19,6 +19,7 @@
  *
  */
 
+#include "ephy-removable-pixbuf-renderer.h"
 #include "gd-main-icon-view.h"
 #include "gd-main-view.h"
 #include "gd-main-view-generic.h"
@@ -77,6 +78,14 @@ gd_main_icon_view_drag_data_get (GtkWidget *widget,
 }
 
 static void
+on_cell_delete_clicked (EphyRemovablePixbufRenderer *cell,
+			const gchar *path,
+			GdMainIconView *self)
+{
+  _gd_main_view_generic_item_delete_clicked (GD_MAIN_VIEW_GENERIC (self), path);
+}
+
+static void
 gd_main_icon_view_constructed (GObject *obj)
 {
   GdMainIconView *self = GD_MAIN_ICON_VIEW (obj);
@@ -96,11 +105,14 @@ gd_main_icon_view_constructed (GObject *obj)
                 "margin", VIEW_MARGIN,
                 NULL);
 
-  self->priv->pixbuf_cell = cell = gd_toggle_pixbuf_renderer_new ();
+  self->priv->pixbuf_cell = cell = ephy_removable_pixbuf_renderer_new ();
   g_object_set (cell,
                 "xalign", 0.5,
                 "yalign", 0.5,
                 NULL);
+  g_signal_connect (cell, "delete-clicked",
+		    G_CALLBACK (on_cell_delete_clicked),
+		    obj);
 
   gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (self), cell, FALSE);
   gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (self), cell,



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