mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
wrappers use the result to be able expand themselves
This commit is contained in:
parent
4a7995e9ad
commit
b859ff99dd
1 changed files with 16 additions and 0 deletions
|
|
@ -19,6 +19,14 @@ class WrapperWidget(QtWidgets.QWidget):
|
|||
|
||||
self.create_ui()
|
||||
|
||||
def make_sure_is_visible(self, *args, **kwargs):
|
||||
changed = False
|
||||
for input_field in self.input_fields:
|
||||
if input_field.make_sure_is_visible(*args, **kwargs):
|
||||
changed = True
|
||||
break
|
||||
return changed
|
||||
|
||||
def create_ui(self):
|
||||
raise NotImplementedError(
|
||||
"{} does not have implemented `create_ui`.".format(
|
||||
|
|
@ -89,6 +97,14 @@ class CollapsibleWrapper(WrapperWidget):
|
|||
else:
|
||||
body_widget.hide_toolbox(hide_content=False)
|
||||
|
||||
def make_sure_is_visible(self, *args, **kwargs):
|
||||
result = super(CollapsibleWrapper, self).make_sure_is_visible(
|
||||
*args, **kwargs
|
||||
)
|
||||
if result:
|
||||
self.body_widget.toggle_content(True)
|
||||
return result
|
||||
|
||||
def add_widget_to_layout(self, widget, label=None):
|
||||
self.input_fields.append(widget)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue