2863: Wrong row when dropping on embedded list

svn: r13090
This commit is contained in:
Benny Malengier 2009-08-20 12:44:29 +00:00
parent 6966e7211a
commit 6db0004c81

View File

@ -250,11 +250,15 @@ class EmbeddedList(ButtonTab):
pass pass
def _find_row(self, x, y): 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: if row is None:
return len(self.get_data()) return len(self.get_data())
else: else:
return row[0][0] 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): def _handle_drag(self, row, obj):
self.get_data().insert(row, obj) self.get_data().insert(row, obj)