changeset e824ed9a8569 in tryton:4.8
details: https://hg.tryton.org/tryton?cmd=changeset;node=e824ed9a8569
description:
        Update selection to the dropped record

        After drag&drop, the treeview keeps the selection at the path where the
        drag&drop started. But as the current_record is not changed, this 
creates an
        inconsistant display. So we ensure that the dropped record is selected 
at the
        end.

        issue8192
        review267371002
        (grafted from c3d403305e97551e8a7df465c18d31547abce081)
diffstat:

 tryton/gui/window/view_form/view/list.py |  3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diffs (13 lines):

diff -r c559c2032ee7 -r e824ed9a8569 tryton/gui/window/view_form/view/list.py
--- a/tryton/gui/window/view_form/view/list.py  Thu May 02 12:49:12 2019 +0200
+++ b/tryton/gui/window/view_form/view/list.py  Sun May 05 19:32:24 2019 +0200
@@ -812,6 +812,9 @@
             gtk.gdk.drop_finish(context, False, etime)
         else:
             context.drop_finish(False, etime)
+        selection = self.treeview.get_selection()
+        selection.unselect_all()
+        selection.select_path(record.get_index_path(model.group))
         if self.attributes.get('sequence'):
             record.group.set_sequence(field=self.attributes['sequence'])
         return True

Reply via email to