mirror of https://github.com/GNOME/gimp.git
app/widgets/gimpcontainertreeview-dnd.c some cleanup in the tree view DND
2004-06-01 Michael Natterer <mitch@gimp.org> * app/widgets/gimpcontainertreeview-dnd.c * app/widgets/gimpitemtreeview.c: some cleanup in the tree view DND code.
This commit is contained in:
parent
f826916828
commit
572577b262
|
@ -1,3 +1,9 @@
|
|||
2004-06-01 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/widgets/gimpcontainertreeview-dnd.c
|
||||
* app/widgets/gimpitemtreeview.c: some cleanup in the tree view
|
||||
DND code.
|
||||
|
||||
2004-06-01 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/widgets/gimpsessioninfo.c (gimp_session_info_restore): added
|
||||
|
|
|
@ -281,19 +281,16 @@ gimp_container_tree_view_real_drop_possible (GimpContainerTreeView *tree_view,
|
|||
{
|
||||
GimpContainerView *view = GIMP_CONTAINER_VIEW (tree_view);
|
||||
GimpContainer *container = gimp_container_view_get_container (view);
|
||||
GimpObject *src_object;
|
||||
GimpObject *dest_object;
|
||||
gint src_index;
|
||||
gint dest_index;
|
||||
|
||||
if (src_viewable == dest_viewable)
|
||||
return FALSE;
|
||||
|
||||
src_object = GIMP_OBJECT (src_viewable);
|
||||
dest_object = GIMP_OBJECT (dest_viewable);
|
||||
|
||||
src_index = gimp_container_get_child_index (container, src_object);
|
||||
dest_index = gimp_container_get_child_index (container, dest_object);
|
||||
src_index = gimp_container_get_child_index (container,
|
||||
GIMP_OBJECT (src_viewable));
|
||||
dest_index = gimp_container_get_child_index (container,
|
||||
GIMP_OBJECT (dest_viewable));
|
||||
|
||||
if (src_index == -1 || dest_index == -1)
|
||||
return FALSE;
|
||||
|
@ -323,16 +320,13 @@ gimp_container_tree_view_real_drop (GimpContainerTreeView *tree_view,
|
|||
{
|
||||
GimpContainerView *view = GIMP_CONTAINER_VIEW (tree_view);
|
||||
GimpContainer *container = gimp_container_view_get_container (view);
|
||||
GimpObject *src_object;
|
||||
GimpObject *dest_object;
|
||||
gint src_index;
|
||||
gint dest_index;
|
||||
|
||||
src_object = GIMP_OBJECT (src_viewable);
|
||||
dest_object = GIMP_OBJECT (dest_viewable);
|
||||
|
||||
src_index = gimp_container_get_child_index (container, src_object);
|
||||
dest_index = gimp_container_get_child_index (container, dest_object);
|
||||
src_index = gimp_container_get_child_index (container,
|
||||
GIMP_OBJECT (src_viewable));
|
||||
dest_index = gimp_container_get_child_index (container,
|
||||
GIMP_OBJECT (dest_viewable));
|
||||
|
||||
if (drop_pos == GTK_TREE_VIEW_DROP_AFTER && src_index > dest_index)
|
||||
{
|
||||
|
@ -343,5 +337,5 @@ gimp_container_tree_view_real_drop (GimpContainerTreeView *tree_view,
|
|||
dest_index--;
|
||||
}
|
||||
|
||||
gimp_container_reorder (container, src_object, dest_index);
|
||||
gimp_container_reorder (container, GIMP_OBJECT (src_viewable), dest_index);
|
||||
}
|
||||
|
|
|
@ -924,18 +924,15 @@ gimp_item_tree_view_drop (GimpContainerTreeView *tree_view,
|
|||
GimpItemTreeView *item_view = GIMP_ITEM_TREE_VIEW (tree_view);
|
||||
GimpItemTreeViewClass *item_view_class;
|
||||
GimpContainer *container;
|
||||
GimpObject *src_object;
|
||||
GimpObject *dest_object;
|
||||
gint src_index;
|
||||
gint dest_index;
|
||||
|
||||
container = gimp_container_view_get_container (container_view);
|
||||
|
||||
src_object = GIMP_OBJECT (src_viewable);
|
||||
dest_object = GIMP_OBJECT (dest_viewable);
|
||||
|
||||
src_index = gimp_container_get_child_index (container, src_object);
|
||||
dest_index = gimp_container_get_child_index (container, dest_object);
|
||||
src_index = gimp_container_get_child_index (container,
|
||||
GIMP_OBJECT (src_viewable));
|
||||
dest_index = gimp_container_get_child_index (container,
|
||||
GIMP_OBJECT (dest_viewable));
|
||||
|
||||
item_view_class = GIMP_ITEM_TREE_VIEW_GET_CLASS (item_view);
|
||||
|
||||
|
@ -965,7 +962,7 @@ gimp_item_tree_view_drop (GimpContainerTreeView *tree_view,
|
|||
}
|
||||
|
||||
item_view_class->reorder_item (item_view->gimage,
|
||||
GIMP_ITEM (src_object),
|
||||
GIMP_ITEM (src_viewable),
|
||||
dest_index,
|
||||
TRUE,
|
||||
item_view_class->reorder_desc);
|
||||
|
|
Loading…
Reference in New Issue