@@ -61,13 +61,13 @@ def register_layout(self, layout_id: str, layout: Layout, lazy_initialization: b
6161 If lazy_initialization is False, the views will not be instantiated unless the passed layout id matches the
6262 current selected layout id.
6363 """
64- with self .registered_layouts_changed .emit_once ():
65- self ._layouts [layout_id ] = layout
66- if not lazy_initialization :
67- self .create_layout_views_if_needed (layout_id )
64+ self ._layouts [layout_id ] = layout
65+ if not lazy_initialization :
66+ self .create_layout_views_if_needed (layout_id )
6867
69- if self ._current_layout == layout_id :
70- self ._refresh_layout ()
68+ if self ._current_layout == layout_id :
69+ self ._refresh_layout ()
70+ self .registered_layouts_changed .emit ()
7171
7272 def set_layout (self , layout_id : str ) -> None :
7373 if layout_id == self ._current_layout :
@@ -137,8 +137,9 @@ def register_layout_dict(self, layout_dict: dict[str, Layout], lazy_initializati
137137 :param lazy_initialization: If True, the layout views will not be created until explicitly requested by
138138 set_layout or create_layout_views_if_needed
139139 """
140- for layout_id , layout in layout_dict .items ():
141- self .register_layout (layout_id , layout , lazy_initialization )
140+ with self .registered_layouts_changed .emit_once ():
141+ for layout_id , layout in layout_dict .items ():
142+ self .register_layout (layout_id , layout , lazy_initialization )
142143
143144 @classmethod
144145 def default_grid_configuration (cls ) -> dict [str , Layout ]:
0 commit comments