From e698eb0caed8164b3bbb85634e6a9ed9840a1c20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 11 Jun 2018 23:19:23 +0200 Subject: [PATCH] Support to add empty widget to HContainer and VContainer The standard container supports adding None as widget so its derivatives should also. issue7508 review48481002 --- tryton/gui/window/view_form/view/form.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tryton/gui/window/view_form/view/form.py b/tryton/gui/window/view_form/view/form.py index 1b3c5132c2..66e2f06170 100644 --- a/tryton/gui/window/view_form/view/form.py +++ b/tryton/gui/window/view_form/view/form.py @@ -135,6 +135,8 @@ class VContainer(Container): pass def add(self, widget, attributes): + if not widget: + return expand = bool(int(attributes.get('yexpand', False))) fill = bool(int(attributes.get('yfill', False))) self.table.pack_start(widget, expand=expand, fill=fill, padding=2) @@ -153,6 +155,8 @@ class HContainer(Container): pass def add(self, widget, attributes): + if not widget: + return expand = bool(int(attributes.get('xexpand', True))) fill = bool(int(attributes.get('xfill', True))) self.table.pack_start(widget, expand=expand, fill=fill, padding=1)