changeset 137038265d95 in tryton:default
details: https://hg.tryton.org/tryton?cmd=changeset&node=137038265d95
description:
Set value on focus out for calendar widgets
We can not rely only on *-changed events to set the value because if
the user
has typed the date in the exact format, the date-time widgets do not
emit a
*-changed event.
issue11815
review425961003
diffstat:
tryton/gui/window/view_form/view/form_gtk/calendar_.py | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diffs (12 lines):
diff -r 7144cfe9287e -r 137038265d95
tryton/gui/window/view_form/view/form_gtk/calendar_.py
--- a/tryton/gui/window/view_form/view/form_gtk/calendar_.py Sat Oct 22
00:58:28 2022 +0200
+++ b/tryton/gui/window/view_form/view/form_gtk/calendar_.py Sat Oct 22
01:05:13 2022 +0200
@@ -28,6 +28,8 @@
self.real_entry.connect('key_press_event', self.sig_key_press)
self.real_entry.connect('activate', self.sig_activate)
self.real_entry.connect('changed', lambda _: self.send_modified())
+ self.real_entry.connect(
+ 'focus-out-event', lambda *a: self._focus_out())
self.entry.connect(self._changed_signal, self.changed)
self.widget.pack_start(self.entry, expand=False, fill=False, padding=0)