modified how preparation of layout works

This commit is contained in:
iLLiCiTiT 2021-06-28 20:02:02 +02:00
parent 9131982be4
commit 84f725b364

View file

@ -40,9 +40,22 @@ class DictConditionalWidget(BaseWidget):
self._parent_widget_by_entity_id = {}
self._enum_key_by_wrapper_id = {}
self._added_wrapper_ids = set()
self._prepare_entity_layouts(
self.entity.gui_layout, self.content_widget
)
# Add enum entity to layout mapping
enum_entity = self.entity.enum_entity
self._parent_widget_by_entity_id[enum_entity.id] = self.content_widget
# Add rest of entities to wrapper mappings
for enum_key, children in self.entity.gui_layout.items():
parent_widget_by_entity_id = {}
self._prepare_entity_layouts(
children,
self.content_widget,
parent_widget_by_entity_id
)
for item_id in parent_widget_by_entity_id.keys():
self._enum_key_by_wrapper_id[item_id] = enum_key
self._parent_widget_by_entity_id.update(parent_widget_by_entity_id)
for child_obj in self.entity.children:
self.input_fields.append(