diff options
author | Claudio Saavedra <csaavedra@igalia.com> | 2012-05-25 16:54:16 +0800 |
---|---|---|
committer | Claudio Saavedra <csaavedra@igalia.com> | 2012-09-01 02:34:00 +0800 |
commit | 9eb6bdb143a1dc91f36d92899fa68358e2b47fe4 (patch) | |
tree | 896afd56f39d4ec6b9c6d043fc598626fc7910ca /lib | |
parent | 86808938842a9998ea0aa801cb1759739d751a18 (diff) | |
download | gsoc2013-epiphany-9eb6bdb143a1dc91f36d92899fa68358e2b47fe4.tar.gz gsoc2013-epiphany-9eb6bdb143a1dc91f36d92899fa68358e2b47fe4.tar.zst gsoc2013-epiphany-9eb6bdb143a1dc91f36d92899fa68358e2b47fe4.zip |
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.
Diffstat (limited to 'lib')
-rw-r--r-- | 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 4cc14c6cd..1f258f243 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, |