changeset 60e29b9f6321 in tryton:6.4
details: https://hg.tryton.org/tryton?cmd=changeset&node=60e29b9f6321
description:
        Select the clicked line when activating a button in list view

        issue11212
        review433141003
        (grafted from e97626052a77e58d84dafbe11c32f7ccea4fdfaa)
diffstat:

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

diffs (21 lines):

diff -r 26069b017018 -r 60e29b9f6321 
tryton/gui/window/view_form/view/list_gtk/widget.py
--- a/tryton/gui/window/view_form/view/list_gtk/widget.py       Thu Sep 01 
22:07:13 2022 +0200
+++ b/tryton/gui/window/view_form/view/list_gtk/widget.py       Sat Sep 17 
18:58:55 2022 +0200
@@ -1305,11 +1305,17 @@
         store = self.view.treeview.get_model()
         record = store.get_value(store.get_iter(path), 0)
 
+        if self.view.record and self.view.record != record:
+            widget.stop_emission_by_name('clicked')
+            return True
+
         state_changes = record.expr_eval(
             self.attrs.get('states', {}))
         if state_changes.get('invisible') \
                 or state_changes.get('readonly'):
             return True
+
+        self.view.treeview.set_cursor(path)
         widget.handler_block_by_func(self.button_clicked)
         try:
             self.view.screen.button(self.attrs)

Reply via email to