2929 QToolButton ,
3030 QStatusBar ,
3131 QWidget ,
32- QFrame ,
33- QSplitter ,
3432)
3533
3634
@@ -82,9 +80,6 @@ def _prime_expected_attrs(self) -> None:
8280 "compiler_tabs" ,
8381 "tab_hello" ,
8482 "toolButton_more" ,
85- "mainSplitter" ,
86- "rightSplitter" ,
87- "topSplitter" ,
8883 ]
8984 for name in names :
9085 if not hasattr (self , name ):
@@ -208,9 +203,6 @@ def _find(cls, name: str):
208203 self .btn_select_icon = None
209204 self .btn_nuitka_icon = None
210205 self .toolButton_more = _find (QToolButton , "toolButton_more" )
211- self .mainSplitter = _find (QSplitter , "mainSplitter" )
212- self .rightSplitter = _find (QSplitter , "rightSplitter" )
213- self .topSplitter = _find (QSplitter , "topSplitter" )
214206 self .log = _find (QTextEdit , "log" )
215207 self .progress = _find (QProgressBar , "progress" )
216208 self .statusbar = self .findChild (QStatusBar , "statusbar" )
@@ -230,78 +222,6 @@ def _find(cls, name: str):
230222 _setup_status_bar (self )
231223
232224
233- def _tune_ide_like_layout (self ) -> None :
234- """Relax tight layout constraints in the IDE-like UI for better label fit."""
235- header = self .ui .findChild (QFrame , "header" )
236- if header is not None :
237- try :
238- header .setMinimumHeight (48 )
239- header .setMaximumHeight (56 )
240- except Exception :
241- pass
242-
243- for btn_name in ("compile_btn" , "cancel_btn" ):
244- btn = getattr (self , btn_name , None )
245- if btn is None :
246- continue
247- try :
248- btn .setMinimumSize (124 , 34 )
249- except Exception :
250- pass
251-
252- workspace_panel = self .ui .findChild (QFrame , "workspace_panel" )
253- if workspace_panel is not None :
254- try :
255- workspace_panel .setMinimumWidth (280 )
256- workspace_panel .setMaximumWidth (400 )
257- except Exception :
258- pass
259-
260- tools_panel = self .ui .findChild (QFrame , "tools_panel" )
261- if tools_panel is not None :
262- try :
263- tools_panel .setMinimumWidth (200 )
264- tools_panel .setMaximumWidth (280 )
265- except Exception :
266- pass
267-
268- logs_panel = self .ui .findChild (QFrame , "logs_panel" )
269- if logs_panel is not None :
270- try :
271- logs_panel .setMinimumHeight (190 )
272- logs_panel .setMaximumHeight (320 )
273- except Exception :
274- pass
275-
276- main_splitter = self .ui .findChild (QSplitter , "mainSplitter" )
277- if main_splitter is not None :
278- try :
279- main_splitter .setStretchFactor (0 , 0 )
280- main_splitter .setStretchFactor (1 , 0 )
281- main_splitter .setStretchFactor (2 , 1 )
282- main_splitter .setSizes ([52 , 300 , 1013 ])
283- except Exception :
284- pass
285-
286- top_splitter = self .ui .findChild (QSplitter , "topSplitter" )
287- if top_splitter is not None :
288- try :
289- top_splitter .setStretchFactor (0 , 1 )
290- top_splitter .setStretchFactor (1 , 0 )
291- top_splitter .setSizes ([820 , 245 ])
292- except Exception :
293- pass
294-
295- right_splitter = self .ui .findChild (QSplitter , "rightSplitter" )
296- if right_splitter is not None :
297- try :
298- right_splitter .setStretchFactor (0 , 1 )
299- right_splitter .setStretchFactor (1 , 0 )
300- right_splitter .setSizes ([470 , 230 ])
301- except Exception :
302- pass
303-
304-
305225def _setup_ide_like_compiler_tabs (self ) -> None :
306226 """Bind engine tabs to compiler_tabs using existing EngineLoader registry."""
307227 tabs = getattr (self , "compiler_tabs" , None )
@@ -632,9 +552,13 @@ def _retranslate_ide_like_actions(self) -> None:
632552def _connect_ide_like_specific_signals (self ) -> None :
633553 """Connect only IDE-specific signals on top of the classic shared wiring."""
634554
635- _connect_classic_signals (self )
636- except Exception :
637- pass
555+ def _connect_clicked (widget , handler ) -> None :
556+ if widget is None or handler is None :
557+ return
558+ try :
559+ widget .clicked .connect (handler )
560+ except Exception :
561+ pass
638562
639563 _connect_clicked (
640564 getattr (self , "activity_btn_deps" , None ),
@@ -647,7 +571,6 @@ def init_ide_like_ui(self) -> None:
647571 """Initialize the ide-like UI and wire it to existing Core methods."""
648572 _load_ide_like_ui (self )
649573 _map_ide_like_widgets (self )
650- _tune_ide_like_layout (self )
651574 _apply_classic_policies (self )
652575 _setup_more_tools_menu (self )
653576 try :
@@ -816,47 +739,3 @@ def _schedule_ide_like_async_init(self) -> None:
816739 QTimer .singleShot (0 , lambda : _setup_ide_like_compiler_tabs (self ))
817740 except Exception :
818741 _setup_ide_like_compiler_tabs (self )
819- try :
820- QTimer .singleShot (0 , lambda : _normalize_ide_splitters (self ))
821- except Exception :
822- _normalize_ide_splitters (self )
823-
824-
825- def _normalize_ide_splitters (self ) -> None :
826- """Harmonize IDE panel proportions to avoid cramped labels/panels."""
827- main_splitter = getattr (self , "mainSplitter" , None )
828- top_splitter = getattr (self , "topSplitter" , None )
829- right_splitter = getattr (self , "rightSplitter" , None )
830-
831- if main_splitter is not None :
832- try :
833- main_splitter .setChildrenCollapsible (False )
834- main_splitter .setStretchFactor (0 , 0 )
835- main_splitter .setStretchFactor (1 , 0 )
836- main_splitter .setStretchFactor (2 , 1 )
837- total = max (1100 , self .width ())
838- main_splitter .setSizes ([52 , 320 , max (640 , total - 372 )])
839- except Exception :
840- pass
841-
842- if top_splitter is not None :
843- try :
844- top_splitter .setChildrenCollapsible (False )
845- top_splitter .setStretchFactor (0 , 4 )
846- top_splitter .setStretchFactor (1 , 1 )
847- total = max (700 , top_splitter .size ().width () or self .width ())
848- tools = min (260 , max (190 , int (total * 0.2 )))
849- top_splitter .setSizes ([max (460 , total - tools ), tools ])
850- except Exception :
851- pass
852-
853- if right_splitter is not None :
854- try :
855- right_splitter .setChildrenCollapsible (False )
856- right_splitter .setStretchFactor (0 , 4 )
857- right_splitter .setStretchFactor (1 , 1 )
858- total_h = max (520 , right_splitter .size ().height () or self .height ())
859- logs_h = min (220 , max (130 , int (total_h * 0.24 )))
860- right_splitter .setSizes ([max (320 , total_h - logs_h ), logs_h ])
861- except Exception :
862- pass
0 commit comments