2323 QProgressBar ,
2424 QPushButton ,
2525 QMenu ,
26+ QSplitter ,
2627 QTabWidget ,
2728 QTextEdit ,
2829 QToolButton ,
3132)
3233
3334
35+ def _tr_ui (self , fr : str , en : str ) -> str :
36+ """Small safe translator helper aligned with Core.i18n usage."""
37+ try :
38+ _t = getattr (self , "tr" , None )
39+ if callable (_t ):
40+ return _t (fr , en )
41+ except Exception :
42+ pass
43+ return en
44+
45+
3446def _prime_expected_attrs (self ) -> None :
3547 """Create expected UI attributes with safe defaults."""
3648 names = [
@@ -70,6 +82,9 @@ def _prime_expected_attrs(self) -> None:
7082 "btn_select_icon" ,
7183 "btn_nuitka_icon" ,
7284 "toolButton_more" ,
85+ "mainSplitter" ,
86+ "rightSplitter" ,
87+ "topSplitter" ,
7388 ]
7489 for name in names :
7590 if not hasattr (self , name ):
@@ -185,6 +200,9 @@ def _find(cls, name: str):
185200 self .btn_select_icon = _find (QPushButton , "btn_select_icon" )
186201 self .btn_nuitka_icon = _find (QPushButton , "btn_nuitka_icon" )
187202 self .toolButton_more = _find (QToolButton , "toolButton_more" )
203+ self .mainSplitter = _find (QSplitter , "mainSplitter" )
204+ self .rightSplitter = _find (QSplitter , "rightSplitter" )
205+ self .topSplitter = _find (QSplitter , "topSplitter" )
188206 self .log = _find (QTextEdit , "log" )
189207 self .progress = _find (QProgressBar , "progress" )
190208 self .statusbar = self .findChild (QStatusBar , "statusbar" )
@@ -486,6 +504,7 @@ def init_ide_like_ui(self) -> None:
486504 _apply_classic_policies (self )
487505 _setup_more_tools_menu (self )
488506 _connect_ide_like_signals (self )
507+ _normalize_ide_splitters (self )
489508 try :
490509 if hasattr (self , "setup_entrypoint_selector" ):
491510 self .setup_entrypoint_selector ()
@@ -503,7 +522,7 @@ def _setup_status_bar(self) -> None:
503522 except Exception :
504523 return
505524 try :
506- self .status_hint = QLabel (" Ready" )
525+ self .status_hint = QLabel (_tr_ui ( self , "Pret" , " Ready") )
507526 self .status_hint .setObjectName ("status_hint" )
508527 self .statusbar .addPermanentWidget (self .status_hint , 1 )
509528 except Exception :
@@ -600,7 +619,7 @@ def _update_status_line(self) -> None:
600619
601620 def _short_path (path : str | None , max_len : int = 28 ) -> str :
602621 if not path :
603- return " None"
622+ return _tr_ui ( self , "Aucun" , " None")
604623 try :
605624 p = os .path .normpath (path )
606625 except Exception :
@@ -620,7 +639,7 @@ def _short_path(path: str | None, max_len: int = 28) -> str:
620639 except Exception :
621640 pass
622641
623- engine_name = " None"
642+ engine_name = _tr_ui ( self , "Aucun" , " None")
624643 try :
625644 tabs = getattr (self , "compiler_tabs" , None )
626645 if tabs is not None and tabs .currentIndex () >= 0 :
@@ -637,13 +656,13 @@ def _short_path(path: str | None, max_len: int = 28) -> str:
637656 pass
638657
639658 parts = [
640- f"Workspace: { ws } " ,
641- f"Files: { files_total } " ,
642- f"Selected: { files_sel } " ,
643- f"Engine: { engine_name } " ,
659+ f"{ _tr_ui ( self , ' Workspace' , 'Workspace' ) } : { ws } " ,
660+ f"{ _tr_ui ( self , 'Fichiers' , ' Files' ) } : { files_total } " ,
661+ f"{ _tr_ui ( self , 'Selection' , ' Selected' ) } : { files_sel } " ,
662+ f"{ _tr_ui ( self , 'Moteur' , ' Engine' ) } : { engine_name } " ,
644663 ]
645664 if prog :
646- parts .append (f"Progress: { prog } " )
665+ parts .append (f"{ _tr_ui ( self , 'Progression' , ' Progress' ) } : { prog } " )
647666
648667 msg = " | " .join (parts )
649668 try :
@@ -660,3 +679,47 @@ def _schedule_ide_like_async_init(self) -> None:
660679 QTimer .singleShot (0 , lambda : _setup_ide_like_compiler_tabs (self ))
661680 except Exception :
662681 _setup_ide_like_compiler_tabs (self )
682+ try :
683+ QTimer .singleShot (0 , lambda : _normalize_ide_splitters (self ))
684+ except Exception :
685+ _normalize_ide_splitters (self )
686+
687+
688+ def _normalize_ide_splitters (self ) -> None :
689+ """Harmonize IDE panel proportions to avoid cramped labels/panels."""
690+ main_splitter = getattr (self , "mainSplitter" , None )
691+ top_splitter = getattr (self , "topSplitter" , None )
692+ right_splitter = getattr (self , "rightSplitter" , None )
693+
694+ if main_splitter is not None :
695+ try :
696+ main_splitter .setChildrenCollapsible (False )
697+ main_splitter .setStretchFactor (0 , 0 )
698+ main_splitter .setStretchFactor (1 , 0 )
699+ main_splitter .setStretchFactor (2 , 1 )
700+ total = max (1100 , self .width ())
701+ main_splitter .setSizes ([52 , 320 , max (640 , total - 372 )])
702+ except Exception :
703+ pass
704+
705+ if top_splitter is not None :
706+ try :
707+ top_splitter .setChildrenCollapsible (False )
708+ top_splitter .setStretchFactor (0 , 4 )
709+ top_splitter .setStretchFactor (1 , 1 )
710+ total = max (700 , top_splitter .size ().width () or self .width ())
711+ tools = min (260 , max (190 , int (total * 0.2 )))
712+ top_splitter .setSizes ([max (460 , total - tools ), tools ])
713+ except Exception :
714+ pass
715+
716+ if right_splitter is not None :
717+ try :
718+ right_splitter .setChildrenCollapsible (False )
719+ right_splitter .setStretchFactor (0 , 4 )
720+ right_splitter .setStretchFactor (1 , 1 )
721+ total_h = max (520 , right_splitter .size ().height () or self .height ())
722+ logs_h = min (220 , max (130 , int (total_h * 0.24 )))
723+ right_splitter .setSizes ([max (320 , total_h - logs_h ), logs_h ])
724+ except Exception :
725+ pass
0 commit comments