2863: Wrong row when dropping on embedded list; again, editfamily

svn: r18624
This commit is contained in:
Michiel Nauta 2011-12-18 09:50:00 +00:00
parent b0d6d87471
commit 5a84ca8606

View File

@ -151,11 +151,15 @@ class ChildEmbedList(EmbeddedList):
return reflist.index(obj)
def _find_row(self, x, y):
row = self.tree.get_path_at_pos(x, y)
row = self.tree.get_dest_row_at_pos(x, y)
if row is None:
return len(self.family.get_child_ref_list())
else:
if row[1] in (gtk.TREE_VIEW_DROP_BEFORE,
gtk.TREE_VIEW_DROP_INTO_OR_BEFORE):
return row[0][0]
else:
return row[0][0]+1
def _handle_drag(self, row, obj):
self.family.get_child_ref_list().insert(row, obj)