mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 08:54:53 +01:00
root triggers hierarchical update
This commit is contained in:
parent
aab1281358
commit
acc18e0e58
2 changed files with 14 additions and 4 deletions
|
|
@ -126,6 +126,8 @@ class BaseEntity:
|
|||
|
||||
self.override_state = OverrideState.NOT_DEFINED
|
||||
|
||||
self.on_change_callbacks = []
|
||||
|
||||
@property
|
||||
def path(self):
|
||||
if self._path is not None:
|
||||
|
|
@ -494,12 +496,11 @@ class RootEntity(BaseEntity):
|
|||
))
|
||||
|
||||
def on_change(self):
|
||||
raise TypeError("{} does not support `on_change`".format(
|
||||
self.__class__.__name__
|
||||
))
|
||||
for callback in self.on_change_callbacks:
|
||||
callback()
|
||||
|
||||
def on_child_change(self, child_obj):
|
||||
pass
|
||||
self.on_change()
|
||||
|
||||
def get_child_path(self, child_obj):
|
||||
for key, _child_obj in self.non_gui_children.items():
|
||||
|
|
|
|||
|
|
@ -519,6 +519,8 @@ class SystemWidget(SettingsCategoryWidget):
|
|||
self.set_state(CategoryState.Working)
|
||||
|
||||
self.entity = base_entity.SystemRootEntity()
|
||||
self.entity.on_change_callbacks.append(self._on_entity_change)
|
||||
self.entity.set_studio_state()
|
||||
|
||||
while self.content_layout.count() != 0:
|
||||
widget = self.content_layout.itemAt(0).widget()
|
||||
|
|
@ -534,6 +536,13 @@ class SystemWidget(SettingsCategoryWidget):
|
|||
|
||||
self.set_state(CategoryState.Idle)
|
||||
|
||||
def _on_entity_change(self):
|
||||
self.hierarchical_style_update()
|
||||
|
||||
def hierarchical_style_update(self):
|
||||
for input_field in self.input_fields:
|
||||
input_field.hierarchical_style_update()
|
||||
|
||||
def add_widget_to_layout(self, widget, label_widget=None):
|
||||
if label_widget:
|
||||
raise NotImplementedError(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue