aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorShaun McCance <Shaun McCance>2009-09-18 06:11:11 +0800
committerShaun McCance <shaunm@gnome.org>2009-11-25 04:50:28 +0800
commit18be92ecfb97887044867643e130ee0ee7c6b3f8 (patch)
treeb67a419153135114cc81ca2a5f9d48dff1bee0b8 /libempathy-gtk
parent3cbb3a10e138e1f777427311bf33f30cb6d4839e (diff)
downloadgsoc2013-empathy-18be92ecfb97887044867643e130ee0ee7c6b3f8.tar
gsoc2013-empathy-18be92ecfb97887044867643e130ee0ee7c6b3f8.tar.gz
gsoc2013-empathy-18be92ecfb97887044867643e130ee0ee7c6b3f8.tar.bz2
gsoc2013-empathy-18be92ecfb97887044867643e130ee0ee7c6b3f8.tar.lz
gsoc2013-empathy-18be92ecfb97887044867643e130ee0ee7c6b3f8.tar.xz
gsoc2013-empathy-18be92ecfb97887044867643e130ee0ee7c6b3f8.tar.zst
gsoc2013-empathy-18be92ecfb97887044867643e130ee0ee7c6b3f8.zip
Allow contacts to be dragged anywhere in a group, or dragged to the non-group
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-contact-list-view.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/libempathy-gtk/empathy-contact-list-view.c b/libempathy-gtk/empathy-contact-list-view.c
index 04a448817..78e1f9020 100644
--- a/libempathy-gtk/empathy-contact-list-view.c
+++ b/libempathy-gtk/empathy-contact-list-view.c
@@ -454,20 +454,35 @@ contact_list_view_drag_motion (GtkWidget *widget,
gtk_tree_model_get_iter (model, &iter, path);
if (target == GDK_NONE) {
- gboolean is_group;
+ GtkTreeIter group_iter;
+ gboolean is_group;
+ GtkTreePath *group_path;
gtk_tree_model_get (model, &iter,
EMPATHY_CONTACT_LIST_STORE_COL_IS_GROUP, &is_group,
-1);
if (is_group) {
+ group_iter = iter;
+ }
+ else {
+ if (gtk_tree_model_iter_parent (model, &group_iter, &iter))
+ gtk_tree_model_get (model, &group_iter,
+ EMPATHY_CONTACT_LIST_STORE_COL_IS_GROUP, &is_group,
+ -1);
+ }
+ if (is_group) {
gdk_drag_status (context, GDK_ACTION_MOVE, time_);
+ group_path = gtk_tree_model_get_path (model, &group_iter);
gtk_tree_view_set_drag_dest_row (GTK_TREE_VIEW (widget),
- path,
+ group_path,
GTK_TREE_VIEW_DROP_INTO_OR_BEFORE);
+ gtk_tree_path_free (group_path);
}
else {
- gdk_drag_status (context, 0, time_);
- gtk_tree_view_set_drag_dest_row (GTK_TREE_VIEW (widget), NULL, 0);
- retval = FALSE;
+ group_path = gtk_tree_path_new_first ();
+ gdk_drag_status (context, GDK_ACTION_MOVE, time_);
+ gtk_tree_view_set_drag_dest_row (GTK_TREE_VIEW (widget),
+ group_path,
+ GTK_TREE_VIEW_DROP_BEFORE);
}
}
else {