From 0d76d32db6d28beb9c4004d89e9b51ae044472fb Mon Sep 17 00:00:00 2001 From: Dinh Long Nguyen Date: Wed, 11 Sep 2024 21:12:34 +0700 Subject: [PATCH] inline tgb controls (#1725) (#1769) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * inline tgb controls * linting * linting --------- Co-authored-by: Fred Lefévère-Laoide <90181748+FredLL-Avaiga@users.noreply.github.com> --- taipy/gui/builder/_element.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/taipy/gui/builder/_element.py b/taipy/gui/builder/_element.py index 5de6c23fd8..d7442aa987 100644 --- a/taipy/gui/builder/_element.py +++ b/taipy/gui/builder/_element.py @@ -62,6 +62,8 @@ def __init__(self, *args, **kwargs) -> None: if args and self._DEFAULT_PROPERTY != "": self._properties = {self._DEFAULT_PROPERTY: args[0]} + # special attribute for inline + self._is_inline = kwargs.pop("inline", False) self._properties.update(kwargs) self.parse_properties() @@ -264,10 +266,11 @@ def __init__(self, *args, **kwargs): # do not remove as it could break the sear def _render(self, gui: "Gui") -> str: self._evaluate_lambdas(gui) el = _BuilderFactory.create_element(gui, self._ELEMENT_NAME, self._deepcopy_properties()) + inline_block = 'style="display:inline-block;"' if self._is_inline else "" return ( - f"
{el[0]}
" + f"
{el[0]}
" if f"<{el[1]}" in el[0] and f"{el[0]}" + else f"
{el[0]}
" ) def __enter__(self):