Skip to content

Commit

Permalink
Merge pull request #181 from shxshxshxshx/dev-reverse-switchwithrefs
Browse files Browse the repository at this point in the history
feat: reverse logic functionality for SwitchWithRefs
  • Loading branch information
eeintech authored Jan 14, 2024
2 parents 7f894dd + ad1c560 commit 22081c1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions kintree/gui/views/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 22081c1

Please sign in to comment.