Fix dropping an item into an empty group item immediately above it

This commit is contained in:
Michael Natterer 2009-08-07 09:46:16 +02:00
parent d2e1f2ac74
commit 4e9f198831
1 changed files with 17 additions and 3 deletions

View File

@ -503,13 +503,27 @@ gimp_container_tree_view_real_drop_possible (GimpContainerTreeView *tree_view,
if (dest_viewable)
{
GimpViewable *parent = gimp_viewable_get_parent (dest_viewable);
GimpViewable *parent;
/* dropping on the lower part of a group item drops into that group */
if (drop_pos == GTK_TREE_VIEW_DROP_AFTER &&
gimp_viewable_get_children (dest_viewable))
{
parent = dest_viewable;
}
else
{
parent = gimp_viewable_get_parent (dest_viewable);
}
if (parent)
dest_container = gimp_viewable_get_children (parent);
else if (gimp_container_have (container, GIMP_OBJECT (dest_viewable)))
dest_container = container;
if (parent == dest_viewable)
dest_index = 0;
else
dest_index = gimp_container_get_child_index (dest_container,
GIMP_OBJECT (dest_viewable));
}