[nautilus] list-view: use the cairo surface as a drag icon
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] list-view: use the cairo surface as a drag icon
- Date: Mon, 5 Aug 2013 11:20:10 +0000 (UTC)
commit 18a380af8d878743aa6ff25b60a0fd77c31b5618
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Mon Aug 5 03:54:18 2013 +0200
list-view: use the cairo surface as a drag icon
As we now store surfaces in the GtkListStore, we have to change the
drag method to use it instead of a pixbuf.
src/nautilus-list-view.c | 20 +++++++++-----------
1 files changed, 9 insertions(+), 11 deletions(-)
---
diff --git a/src/nautilus-list-view.c b/src/nautilus-list-view.c
index ff3c698..badbe2f 100644
--- a/src/nautilus-list-view.c
+++ b/src/nautilus-list-view.c
@@ -396,13 +396,13 @@ stop_drag_check (NautilusListView *view)
view->details->drag_button = 0;
}
-static GdkPixbuf *
-get_drag_pixbuf (NautilusListView *view)
+static cairo_surface_t *
+get_drag_surface (NautilusListView *view)
{
GtkTreeModel *model;
GtkTreePath *path;
GtkTreeIter iter;
- GdkPixbuf *ret;
+ cairo_surface_t *ret;
GdkRectangle cell_area;
ret = NULL;
@@ -503,14 +503,12 @@ drag_begin_callback (GtkWidget *widget,
NautilusListView *view)
{
GList *selection_cache;
- GdkPixbuf *pixbuf;
-
- pixbuf = get_drag_pixbuf (view);
- if (pixbuf) {
- gtk_drag_set_icon_pixbuf (context,
- pixbuf,
- 0, 0);
- g_object_unref (pixbuf);
+ cairo_surface_t *surface;
+
+ surface = get_drag_surface (view);
+ if (surface) {
+ gtk_drag_set_icon_surface (context, surface);
+ cairo_surface_destroy (surface);
} else {
gtk_drag_set_icon_default (context);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]