From ad1c560139644e79569856eb26451df3c77a395d Mon Sep 17 00:00:00 2001 From: Sebastian Hierholzer Date: Tue, 17 Oct 2023 20:42:03 +0200 Subject: [PATCH] feat: reverse logic functionality for SwitchWithRefs --- kintree/gui/views/common.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kintree/gui/views/common.py b/kintree/gui/views/common.py index 31001002..c594df32 100644 --- a/kintree/gui/views/common.py +++ b/kintree/gui/views/common.py @@ -183,14 +183,18 @@ class SwitchWithRefs(ft.Switch): def __init__( self, refs: List[ft.Ref] = None, + reverse_dir: bool = False, **kwargs, ): super().__init__(**kwargs) if refs: self.refs = refs self.enable_refs(self.value) + self.reverse_dir = reverse_dir def enable_refs(self, enable): + if self.reverse_dir: + enable = not enable for ref in self.linked_refs: ref.current.visible = enable try: