@@ -92,15 +92,16 @@ def __init__(
9292 view .product_view ,
9393 self ._file_dialog_factory ,
9494 )
95- self ._product_visualization_controller = ProductVisualizationController (
96- model .analysis_core .residual_analyzer ,
97- model .analysis_core .residual_real_space_visualization_engine ,
98- model .analysis_core .residual_reciprocal_space_visualization_engine ,
99- self ._product_controller ,
100- view .product_visualization_view ,
101- self ._status_bar ,
102- self ._file_dialog_factory ,
103- )
95+ if is_developer_mode_enabled :
96+ self ._product_visualization_controller = ProductVisualizationController (
97+ model .analysis_core .residual_analyzer ,
98+ model .analysis_core .residual_real_space_visualization_engine ,
99+ model .analysis_core .residual_reciprocal_space_visualization_engine ,
100+ self ._product_controller ,
101+ view .product_visualization_view ,
102+ self ._status_bar ,
103+ self ._file_dialog_factory ,
104+ )
104105 self ._probe_positions_controller = ProbePositionsController (
105106 model .product_core .probe_positions_repository ,
106107 model .product_core .probe_positions_api ,
@@ -209,7 +210,7 @@ def __init__(
209210 view .genesis_action : model .genesis_core .is_supported ,
210211 }
211212
212- self ._swap_central_widgets (view .patterns_action )
213+ self ._swap_central_widgets (view .patterns_action , animated = False )
213214 view .patterns_action .setChecked (True )
214215 view .navigation .action_group .triggered .connect (
215216 lambda action : self ._swap_central_widgets (action )
@@ -222,19 +223,20 @@ def show_main_window(self, window_title: str) -> None:
222223 self .view .setWindowTitle (window_title )
223224 self .view .show ()
224225
225- def _swap_central_widgets (self , action : QAction | None ) -> None :
226+ def _swap_central_widgets (self , action : QAction | None , * , animated : bool = True ) -> None :
226227 if action is None :
227228 raise ValueError ('QAction is None!' )
228229
229230 self .view .navigation .set_current_index (action .data ())
230- self ._update_subview_visibility (action )
231+ self ._update_subview_visibility (action , animated = animated )
231232
232- def _update_subview_visibility (self , action : QAction ) -> None :
233+ def _update_subview_visibility (self , action : QAction , * , animated : bool = True ) -> None :
233234 for group in self .view .navigation .subview_groups :
234235 expanded = action is group .parent_action or action in group .child_actions
235236 for child in group .child_actions :
236237 allowed = self ._action_permitted .get (child , True )
237- child .setVisible (expanded and allowed )
238+ group .container .set_child_button_visible (child , allowed )
239+ group .container .set_expanded (expanded , animated = animated )
238240 group .top_separator .setVisible (expanded )
239241 group .bottom_separator .setVisible (expanded )
240242
0 commit comments