"""Dialogue Definition des fonds perdus.""" from PyQt6.QtWidgets import (QDialog, QVBoxLayout, QHBoxLayout, QLabel, QGroupBox, QDoubleSpinBox, QDialogButtonBox) class BleedsDialog(QDialog): def __init__(self, parent=None): super().__init__(parent) self.setWindowTitle("Fonds perdus (Bleeds)") self.setMinimumWidth(350) self._setup_ui() def _setup_ui(self): layout = QVBoxLayout(self) layout.addWidget(QLabel( "Definir la zone de fond perdu autour de chaque page.\n" "Cette zone sera prise en compte par les fonctions N-Up et Repetition." )) grp = QGroupBox("Fonds perdus (mm)") gl = QVBoxLayout(grp) self.spins = {} for label in ["Haut", "Bas", "Gauche", "Droite"]: hl = QHBoxLayout() hl.addWidget(QLabel(f"{label} :")) spin = QDoubleSpinBox() spin.setRange(0, 50) spin.setValue(3) spin.setSuffix(" mm") hl.addWidget(spin) hl.addStretch() gl.addLayout(hl) self.spins[label.lower()] = spin layout.addWidget(grp) buttons = QDialogButtonBox( QDialogButtonBox.StandardButton.Ok | QDialogButtonBox.StandardButton.Cancel ) buttons.accepted.connect(self.accept) buttons.rejected.connect(self.reject) layout.addWidget(buttons) def get_settings(self): return { "bleed_top": self.spins["haut"].value(), "bleed_bottom": self.spins["bas"].value(), "bleed_left": self.spins["gauche"].value(), "bleed_right": self.spins["droite"].value(), }