Skip to content

Commit db655ea

Browse files
committed
engines-ui: adopter le design type Cleaner pour les tabs
- structure les options par sections QGroupBox - harmonise marges, espacements et hints compacts - conserve la compatibilite des attributs attendus par le compilateur
1 parent 31d53f1 commit db655ea

3 files changed

Lines changed: 99 additions & 18 deletions

File tree

ENGINES/cx_freeze/engine.py

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -729,18 +729,26 @@ def create_tab(self, gui):
729729
QCheckBox,
730730
QComboBox,
731731
QFileDialog,
732+
QFormLayout,
733+
QGroupBox,
732734
QHBoxLayout,
733735
QLabel,
734736
QLineEdit,
735737
QPushButton,
738+
QSizePolicy,
736739
QVBoxLayout,
737740
QWidget,
738741
)
739742
except Exception:
740743
return None
741744
tab = QWidget()
742745
layout = QVBoxLayout(tab)
746+
layout.setSpacing(8)
747+
layout.setContentsMargins(8, 8, 8, 8)
743748
self._cx_title = None
749+
output_group = QGroupBox(gui.tr("Sortie", "Output"), tab)
750+
output_form = QFormLayout()
751+
output_form.setSpacing(6)
744752
# Output dir row
745753
row = QHBoxLayout()
746754
out_edit = QLineEdit()
@@ -785,14 +793,14 @@ def _browse():
785793
pass
786794
row.addWidget(out_edit)
787795
row.addWidget(browse_btn)
788-
layout.addLayout(row)
796+
output_form.addRow(QLabel(gui.tr("Dossier de sortie", "Output directory")), row)
789797
# Target name
790798
row_tn = QHBoxLayout()
791799
try:
792800
tn_label = QLabel(gui.tr("Nom de la cible", "Target name"))
793-
row_tn.addWidget(tn_label)
794801
self._cx_tn_label = tn_label
795802
except Exception:
803+
tn_label = QLabel(gui.tr("Nom de la cible", "Target name"))
796804
self._cx_tn_label = None
797805
tn_edit = QLineEdit()
798806
tn_edit.setObjectName("cx_target_name")
@@ -801,8 +809,12 @@ def _browse():
801809
except Exception:
802810
pass
803811
row_tn.addWidget(tn_edit)
804-
layout.addLayout(row_tn)
812+
output_form.addRow(tn_label, row_tn)
813+
output_group.setLayout(output_form)
805814
self._target_name_input = tn_edit
815+
build_group = QGroupBox(gui.tr("Options de build", "Build options"), tab)
816+
build_layout = QVBoxLayout()
817+
build_layout.setSpacing(6)
806818
# Base selection and include-deps
807819
row2 = QHBoxLayout()
808820
base_label = QLabel(gui.tr("Base", "Base"))
@@ -826,11 +838,14 @@ def _browse():
826838
row2.addWidget(cb_deps)
827839
row2.addWidget(cb_enc)
828840
row2.addStretch(1)
829-
layout.addLayout(row2)
841+
build_layout.addLayout(row2)
830842
self._base_label = base_label
831843
self._base_combo = base_combo
832844
self._cb_include_deps = cb_deps
833845
self._cb_enc = cb_enc
846+
assets_group = QGroupBox(gui.tr("Ressources", "Assets"), tab)
847+
assets_layout = QVBoxLayout()
848+
assets_layout.setSpacing(6)
834849
# Icon picker
835850
row3 = QHBoxLayout()
836851
try:
@@ -863,7 +878,7 @@ def _browse_icon():
863878
pass
864879
row3.addWidget(icon_edit)
865880
row3.addWidget(icon_btn)
866-
layout.addLayout(row3)
881+
assets_layout.addLayout(row3)
867882
# Optimize level
868883
opt_row = QHBoxLayout()
869884
try:
@@ -876,7 +891,23 @@ def _browse_icon():
876891
opt_combo.addItems(["0", "1", "2"]) # python -O / -OO equivalent
877892
opt_row.addWidget(opt_combo)
878893
opt_row.addStretch(1)
879-
layout.addLayout(opt_row)
894+
assets_layout.addLayout(opt_row)
895+
build_group.setLayout(build_layout)
896+
assets_group.setLayout(assets_layout)
897+
hint = QLabel(
898+
gui.tr(
899+
"Astuce: garde une configuration compacte, puis ajuste seulement si nécessaire.",
900+
"Tip: keep a compact setup, then tune only what you need.",
901+
),
902+
tab,
903+
)
904+
hint.setStyleSheet("color: #888; font-size: 11px;")
905+
hint.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
906+
layout.addWidget(output_group)
907+
layout.addWidget(build_group)
908+
layout.addWidget(assets_group)
909+
layout.addWidget(hint)
910+
layout.addStretch(1)
880911
# Keep references for build_command/on_success
881912
self._output_dir_input = out_edit
882913
self._target_name_input = tn_edit

ENGINES/nuitka/engine.py

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -416,10 +416,13 @@ def _t(fr: str, en: str) -> str:
416416
from PySide6.QtWidgets import (
417417
QCheckBox,
418418
QFileDialog,
419+
QFormLayout,
420+
QGroupBox,
419421
QHBoxLayout,
420422
QLabel,
421423
QLineEdit,
422424
QPushButton,
425+
QSizePolicy,
423426
QVBoxLayout,
424427
QWidget,
425428
)
@@ -428,7 +431,12 @@ def _t(fr: str, en: str) -> str:
428431

429432
tab = QWidget()
430433
layout = QVBoxLayout(tab)
434+
layout.setSpacing(8)
435+
layout.setContentsMargins(8, 8, 8, 8)
431436

437+
mode_group = QGroupBox(_t("Mode de build", "Build mode"), tab)
438+
mode_layout = QVBoxLayout()
439+
mode_layout.setSpacing(4)
432440
self._n_onefile = QCheckBox(_t("Onefile", "Onefile"))
433441
self._n_standalone = QCheckBox(_t("Standalone", "Standalone"))
434442
self._n_disable_console = QCheckBox(_t("Désactiver console (Windows)", "Disable console (Windows)"))
@@ -445,11 +453,14 @@ def _t(fr: str, en: str) -> str:
445453
self._n_disable_console,
446454
self._n_show_progress,
447455
):
448-
layout.addWidget(cb)
456+
mode_layout.addWidget(cb)
457+
mode_group.setLayout(mode_layout)
449458

450459
# Output directory
460+
output_group = QGroupBox(_t("Sortie", "Output"), tab)
461+
output_form = QFormLayout()
462+
output_form.setSpacing(6)
451463
row_dir = QHBoxLayout()
452-
lbl_dir = QLabel(_t("Dossier de sortie", "Output directory"))
453464
out_dir = QLineEdit()
454465
out_dir.setPlaceholderText(_t("Dossier build Nuitka", "Nuitka build directory"))
455466
btn_dir = QPushButton(_t("Parcourir...", "Browse..."))
@@ -469,10 +480,25 @@ def _browse_out():
469480
btn_dir.clicked.connect(_browse_out)
470481
except Exception:
471482
pass
472-
row_dir.addWidget(lbl_dir)
473483
row_dir.addWidget(out_dir)
474484
row_dir.addWidget(btn_dir)
475-
layout.addLayout(row_dir)
485+
output_form.addRow(QLabel(_t("Dossier de sortie", "Output directory")), row_dir)
486+
output_group.setLayout(output_form)
487+
488+
hint = QLabel(
489+
_t(
490+
"Astuce: combine Standalone + Onefile seulement si nécessaire.",
491+
"Tip: combine Standalone + Onefile only when needed.",
492+
),
493+
tab,
494+
)
495+
hint.setStyleSheet("color: #888; font-size: 11px;")
496+
hint.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
497+
498+
layout.addWidget(mode_group)
499+
layout.addWidget(output_group)
500+
layout.addWidget(hint)
501+
layout.addStretch(1)
476502

477503
# Keep GUI attribute compatibility for command builder.
478504
gui.nuitka_onefile = self._n_onefile

ENGINES/pyinstaller/engine.py

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -288,10 +288,13 @@ def create_tab(self, gui):
288288
from PySide6.QtWidgets import (
289289
QCheckBox,
290290
QFileDialog,
291+
QFormLayout,
292+
QGroupBox,
291293
QHBoxLayout,
292294
QLabel,
293295
QLineEdit,
294296
QPushButton,
297+
QSizePolicy,
295298
QVBoxLayout,
296299
QWidget,
297300
)
@@ -300,19 +303,21 @@ def create_tab(self, gui):
300303

301304
tab = QWidget()
302305
layout = QVBoxLayout(tab)
306+
layout.setSpacing(8)
307+
layout.setContentsMargins(8, 8, 8, 8)
303308

304309
# Output name
305-
row_name = QHBoxLayout()
310+
output_group = QGroupBox(gui.tr("Sortie", "Output"), tab)
311+
output_form = QFormLayout()
312+
output_form.setSpacing(6)
313+
306314
lbl_name = QLabel(gui.tr("Nom de sortie", "Output name"))
307315
out_name = QLineEdit()
308316
out_name.setPlaceholderText(gui.tr("Nom de l'exécutable", "Executable name"))
309-
row_name.addWidget(lbl_name)
310-
row_name.addWidget(out_name)
311-
layout.addLayout(row_name)
317+
output_form.addRow(lbl_name, out_name)
312318

313319
# Output directory
314320
row_dir = QHBoxLayout()
315-
lbl_dir = QLabel(gui.tr("Dossier de sortie", "Output directory"))
316321
out_dir = QLineEdit()
317322
out_dir.setPlaceholderText(gui.tr("Dossier dist", "Dist directory"))
318323
btn_dir = QPushButton(gui.tr("Parcourir...", "Browse..."))
@@ -332,12 +337,15 @@ def _browse_out():
332337
btn_dir.clicked.connect(_browse_out)
333338
except Exception:
334339
pass
335-
row_dir.addWidget(lbl_dir)
336340
row_dir.addWidget(out_dir)
337341
row_dir.addWidget(btn_dir)
338-
layout.addLayout(row_dir)
342+
output_form.addRow(QLabel(gui.tr("Dossier de sortie", "Output directory")), row_dir)
343+
output_group.setLayout(output_form)
339344

340345
# Core options used by build_pyinstaller_command
346+
options_group = QGroupBox(gui.tr("Options de build", "Build options"), tab)
347+
options_layout = QVBoxLayout()
348+
options_layout.setSpacing(4)
341349
self._opt_onefile = QCheckBox(gui.tr("Onefile", "Onefile"))
342350
self._opt_windowed = QCheckBox(gui.tr("Sans console", "Windowed"))
343351
self._opt_noconfirm = QCheckBox(gui.tr("No confirm", "No confirm"))
@@ -353,7 +361,23 @@ def _browse_out():
353361
self._opt_noupx,
354362
self._opt_debug,
355363
):
356-
layout.addWidget(cb)
364+
options_layout.addWidget(cb)
365+
options_group.setLayout(options_layout)
366+
367+
hint = QLabel(
368+
gui.tr(
369+
"Astuce: active uniquement les options nécessaires.",
370+
"Tip: enable only the options you need.",
371+
),
372+
tab,
373+
)
374+
hint.setStyleSheet("color: #888; font-size: 11px;")
375+
hint.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
376+
377+
layout.addWidget(output_group)
378+
layout.addWidget(options_group)
379+
layout.addWidget(hint)
380+
layout.addStretch(1)
357381

358382
# Store on GUI for compiler command builder compatibility.
359383
gui.output_name_input = out_name

0 commit comments

Comments
 (0)