Initial commit — Copydev Imposing Tool
Outil d'imposition PDF desktop (PyQt6) remplacant Quite Imposing Plus. 9 fonctions : livret, n-up, step & repeat, imposition manuelle, jointure pages, pages blanches, numerotation, masquage, fonds perdus. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
53
app/dialogs/bleeds_dialog.py
Normal file
53
app/dialogs/bleeds_dialog.py
Normal file
@@ -0,0 +1,53 @@
|
||||
"""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(),
|
||||
}
|
||||
Reference in New Issue
Block a user