Skip to content

Commit 69cb376

Browse files
committed
ui: homogeniser l'IDE et nettoyer les elements visuels
- calibre les splitters pour un rendu plus stable et responsive - harmonise la ligne de statut avec traduction FR/EN - retire les emojis visibles dans les libelles et dialogues - ajuste les textes d'actions pour une interface plus coherente
1 parent 5c6ced3 commit 69cb376

4 files changed

Lines changed: 77 additions & 14 deletions

File tree

Core/Gui.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ def closeEvent(self, event):
465465
if not is_french:
466466
mapping = {"compilation": "build"}
467467
details_disp = [mapping.get(d, d) for d in details]
468-
title = "⚠️ Process Running"
468+
title = "Process Running"
469469
msg = "A process is currently running:\n\n"
470470
if details_disp:
471471
for detail in details_disp:
@@ -477,7 +477,7 @@ def closeEvent(self, event):
477477
no_text = "No, Continue"
478478
else:
479479
details_disp = details
480-
title = "⚠️ Processus en cours"
480+
title = "Processus en cours"
481481
msg = "Un processus est actuellement en cours :\n\n"
482482
if details_disp:
483483
for detail in details_disp:

Core/IdeLikeGui/connections.py

Lines changed: 71 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
QProgressBar,
2424
QPushButton,
2525
QMenu,
26+
QSplitter,
2627
QTabWidget,
2728
QTextEdit,
2829
QToolButton,
@@ -31,6 +32,17 @@
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+
3446
def _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

ui/ui_design.ui

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ QLineEdit:disabled, QTextEdit:disabled {
414414
<item>
415415
<widget class="QPushButton" name="btn_build_all">
416416
<property name="text">
417-
<string>🚀 Compiler</string>
417+
<string>Compiler</string>
418418
</property>
419419
</widget>
420420
</item>
@@ -1480,4 +1480,4 @@ QLineEdit:disabled, QTextEdit:disabled {
14801480
</widget>
14811481
<resources/>
14821482
<connections/>
1483-
</ui>
1483+
</ui>

ui/ui_ide_design2.ui

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ QProgressBar::chunk { background: #0e639c; }</string>
239239
</size>
240240
</property>
241241
<property name="toolTip">
242-
<string>Analyser dépendances</string>
242+
<string>Analyze dependencies</string>
243243
</property>
244244
<property name="text">
245245
<string/>
@@ -368,7 +368,7 @@ QProgressBar::chunk { background: #0e639c; }</string>
368368
<item>
369369
<widget class="QPushButton" name="btn_remove_file">
370370
<property name="text">
371-
<string>Supprimer</string>
371+
<string>Remove</string>
372372
</property>
373373
</widget>
374374
</item>

0 commit comments

Comments
 (0)