Commit 371c3a38 authored by Christian Neumair's avatar Christian Neumair Committed by Christian Neumair

Setup drag in the "drag-begin" handler.

2005-09-19  Christian Neumair  <chris@gnome-de.org>

	* src/file-manager/fm-list-view.c: (drag_begin_callback),
	(motion_notify_callback):
	Setup drag in the "drag-begin" handler.
parent afd498df
2005-09-19 Christian Neumair <chris@gnome-de.org>
* src/file-manager/fm-list-view.c: (drag_begin_callback),
(motion_notify_callback):
Setup drag in the "drag-begin" handler.
2005-09-19 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-icon-container.[ch]:
......
......@@ -406,6 +406,34 @@ get_drag_pixbuf (FMListView *view)
return ret;
}
static void
drag_begin_callback (GtkWidget *widget,
GdkDragContext *context,
FMListView *view)
{
GList *ref_list;
GdkPixbuf *pixbuf;
pixbuf = get_drag_pixbuf (view);
if (pixbuf) {
gtk_drag_set_icon_pixbuf (context,
pixbuf,
0, 0);
g_object_unref (pixbuf);
} else {
gtk_drag_set_icon_default (context);
}
stop_drag_check (view);
view->details->drag_started = TRUE;
ref_list = get_filtered_selection_refs (GTK_TREE_VIEW (widget));
g_object_set_data_full (G_OBJECT (context),
"drag-info",
ref_list,
(GDestroyNotify)ref_list_free);
}
static gboolean
motion_notify_callback (GtkWidget *widget,
GdkEventMotion *event,
......@@ -414,8 +442,6 @@ motion_notify_callback (GtkWidget *widget,
FMListView *view;
GdkDragContext *context;
GdkCursor *cursor;
GList *ref_list;
GdkPixbuf *pixbuf;
GtkTreePath *last_hover_path;
GtkTreeIter iter;
......@@ -476,25 +502,6 @@ motion_notify_callback (GtkWidget *widget,
GDK_ACTION_MOVE | GDK_ACTION_COPY | GDK_ACTION_LINK | GDK_ACTION_ASK,
view->details->drag_button,
(GdkEvent*)event);
stop_drag_check (view);
view->details->drag_started = TRUE;
ref_list = get_filtered_selection_refs (GTK_TREE_VIEW (widget));
g_object_set_data_full (G_OBJECT (context),
"drag-info",
ref_list,
(GDestroyNotify)ref_list_free);
pixbuf = get_drag_pixbuf (view);
if (pixbuf) {
gtk_drag_set_icon_pixbuf (context,
pixbuf,
0, 0);
g_object_unref (pixbuf);
} else {
gtk_drag_set_icon_default (context);
}
}
return TRUE;
}
......@@ -1346,6 +1353,8 @@ create_and_set_up_tree_view (FMListView *view)
"changed",
G_CALLBACK (list_selection_changed_callback), view, 0);
g_signal_connect_object (view->details->tree_view, "drag_begin",
G_CALLBACK (drag_begin_callback), view, 0);
g_signal_connect_object (view->details->tree_view, "drag_data_get",
G_CALLBACK (drag_data_get_callback), view, 0);
g_signal_connect_object (view->details->tree_view, "motion_notify_event",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment