V2.5.0 — Theme gris moderne + fix recadrage

- Theme gris clair moderne avec accents cyan (#00b4d8)
  - Fond #e8e8e8, menus #f2f2f2, boutons blancs, hover cyan
  - Viewer fond gris, vignettes fond blanc
  - Splash screen en theme clair
  - Scrollbars, menus, dialogues tous en gris/cyan
- Fix recadrage : dialogue garde une reference (plus de garbage collection)
- Popup recadrage compact (360px fixe) et non-modal
- A propos adapte au theme clair

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jules
2026-03-21 14:40:31 +01:00
parent 98049cd3cb
commit d7a538aa8c
7 changed files with 86 additions and 89 deletions

View File

@@ -12,9 +12,9 @@ class CropDialog(QDialog):
current_page=0, viewer=None, parent=None): current_page=0, viewer=None, parent=None):
super().__init__(parent) super().__init__(parent)
self.setWindowTitle("Recadrer") self.setWindowTitle("Recadrer")
self.setMinimumWidth(450) self.setFixedWidth(360)
self.setModal(False) # Non-modal pour pouvoir interagir avec le viewer self.setModal(False)
self.setWindowFlags(self.windowFlags() | Qt.WindowType.Tool) # Reste au dessus self.setWindowFlags(self.windowFlags() | Qt.WindowType.Tool)
self._page_w = page_width_pt self._page_w = page_width_pt
self._page_h = page_height_pt self._page_h = page_height_pt
self._total_pages = total_pages self._total_pages = total_pages

View File

@@ -65,111 +65,106 @@ class MainWindow(QMainWindow):
self._setup_ui() self._setup_ui()
self._setup_statusbar() self._setup_statusbar()
# Style global moderne # Style gris moderne avec accents cyan
self.setStyleSheet(""" self.setStyleSheet("""
* { font-family: 'Segoe UI', sans-serif; } * { font-family: 'Segoe UI', sans-serif; }
QMainWindow { background: #1e1e2e; } QMainWindow { background: #e8e8e8; }
QMenuBar { QMenuBar {
background: #181825; color: #cdd6f4; font-size: 13px; background: #f2f2f2; color: #2d2d2d; font-size: 13px;
padding: 3px 0; border-bottom: 1px solid #313244; padding: 2px 0; border-bottom: 1px solid #d0d0d0;
} }
QMenuBar::item { padding: 4px 12px; border-radius: 4px; margin: 1px 2px; } QMenuBar::item { padding: 5px 12px; border-radius: 4px; margin: 1px 2px; }
QMenuBar::item:selected { background: #45475a; } QMenuBar::item:selected { background: #d8d8d8; }
QMenu { QMenu {
background: #1e1e2e; color: #cdd6f4; border: 1px solid #45475a; background: #ffffff; color: #2d2d2d; border: 1px solid #d0d0d0;
border-radius: 8px; padding: 4px; border-radius: 8px; padding: 4px;
} }
QMenu::item { padding: 6px 24px; border-radius: 4px; } QMenu::item { padding: 6px 24px; border-radius: 4px; }
QMenu::item:selected { background: #45475a; } QMenu::item:selected { background: #e0f4ff; color: #006fa6; }
QMenu::separator { background: #313244; height: 1px; margin: 4px 12px; } QMenu::separator { background: #e0e0e0; height: 1px; margin: 4px 12px; }
QToolBar { QToolBar {
background: #181825; border: none; spacing: 2px; padding: 4px; background: #f2f2f2; border: none; spacing: 2px; padding: 4px;
border-bottom: 1px solid #313244; border-bottom: 1px solid #d0d0d0;
} }
QToolBar QToolButton { QToolBar QToolButton {
color: #bac2de; padding: 5px 10px; border-radius: 6px; color: #444; padding: 5px 10px; border-radius: 6px;
font-size: 12px; border: 1px solid transparent; font-size: 12px; border: 1px solid transparent;
} }
QToolBar QToolButton:hover { QToolBar QToolButton:hover {
background: #313244; border: 1px solid #45475a; color: #cdd6f4; background: #d8f0f8; border: 1px solid #00b4d8; color: #006fa6;
} }
QToolBar QToolButton:pressed { background: #45475a; } QToolBar QToolButton:pressed { background: #b8e6f0; }
QStatusBar { QStatusBar {
background: #11111b; color: #6c7086; font-size: 11px; background: #f2f2f2; color: #888; font-size: 11px;
border-top: 1px solid #313244; border-top: 1px solid #d0d0d0;
} }
QSplitter::handle { background: #313244; width: 2px; } QSplitter::handle { background: #d0d0d0; width: 2px; }
QSplitter::handle:hover { background: #89b4fa; } QSplitter::handle:hover { background: #00b4d8; }
QDialog { background: #f5f5f5; color: #2d2d2d; }
QDialog {
background: #1e1e2e; color: #cdd6f4;
}
QGroupBox { QGroupBox {
color: #cdd6f4; border: 1px solid #45475a; border-radius: 8px; color: #2d2d2d; border: 1px solid #d0d0d0; border-radius: 8px;
margin-top: 12px; padding-top: 16px; font-weight: bold; margin-top: 12px; padding-top: 16px; font-weight: bold;
background: #ffffff;
} }
QGroupBox::title { QGroupBox::title {
subcontrol-origin: margin; left: 12px; padding: 0 6px; subcontrol-origin: margin; left: 12px; padding: 0 6px;
color: #89b4fa; color: #00b4d8;
} }
QLabel { color: #cdd6f4; }
QLabel { color: #2d2d2d; }
QLineEdit, QSpinBox, QDoubleSpinBox, QComboBox, QTextEdit { QLineEdit, QSpinBox, QDoubleSpinBox, QComboBox, QTextEdit {
background: #313244; color: #cdd6f4; border: 1px solid #45475a; background: #ffffff; color: #2d2d2d; border: 1px solid #ccc;
border-radius: 6px; padding: 4px 8px; border-radius: 6px; padding: 5px 8px;
} }
QLineEdit:focus, QSpinBox:focus, QDoubleSpinBox:focus, QComboBox:focus, QTextEdit:focus { QLineEdit:focus, QSpinBox:focus, QDoubleSpinBox:focus, QComboBox:focus, QTextEdit:focus {
border: 1px solid #89b4fa; border: 1px solid #00b4d8;
}
QComboBox::drop-down {
border: none; padding-right: 8px;
} }
QComboBox::drop-down { border: none; padding-right: 8px; }
QComboBox QAbstractItemView { QComboBox QAbstractItemView {
background: #313244; color: #cdd6f4; border: 1px solid #45475a; background: #ffffff; color: #2d2d2d; border: 1px solid #d0d0d0;
selection-background-color: #45475a; selection-background-color: #e0f4ff;
selection-color: #006fa6;
} }
QPushButton { QPushButton {
background: #45475a; color: #cdd6f4; border: 1px solid #585b70; background: #f0f0f0; color: #2d2d2d; border: 1px solid #ccc;
border-radius: 6px; padding: 6px 14px; font-size: 12px; border-radius: 6px; padding: 6px 14px; font-size: 12px;
} }
QPushButton:hover { background: #585b70; border-color: #89b4fa; } QPushButton:hover { background: #d8f0f8; border-color: #00b4d8; color: #006fa6; }
QPushButton:pressed { background: #313244; } QPushButton:pressed { background: #b8e6f0; }
QRadioButton, QCheckBox { color: #cdd6f4; spacing: 6px; } QRadioButton, QCheckBox { color: #2d2d2d; spacing: 6px; }
QRadioButton::indicator, QCheckBox::indicator {
width: 16px; height: 16px;
}
QDialogButtonBox QPushButton { QDialogButtonBox QPushButton { min-width: 80px; }
min-width: 80px;
}
QProgressBar { QProgressBar { background: #e0e0e0; border: none; height: 3px; }
background: #11111b; border: none; height: 3px; QProgressBar::chunk { background: #00b4d8; border-radius: 1px; }
}
QProgressBar::chunk { background: #89b4fa; border-radius: 1px; }
QScrollBar:vertical { QScrollBar:vertical {
background: #181825; width: 10px; border: none; background: #f0f0f0; width: 10px; border: none;
} }
QScrollBar::handle:vertical { QScrollBar::handle:vertical {
background: #45475a; border-radius: 5px; min-height: 30px; background: #c0c0c0; border-radius: 5px; min-height: 30px;
} }
QScrollBar::handle:vertical:hover { background: #585b70; } QScrollBar::handle:vertical:hover { background: #a0a0a0; }
QScrollBar::add-line, QScrollBar::sub-line { height: 0; } QScrollBar::add-line, QScrollBar::sub-line { height: 0; }
QScrollBar:horizontal { QScrollBar:horizontal {
background: #181825; height: 10px; border: none; background: #f0f0f0; height: 10px; border: none;
} }
QScrollBar::handle:horizontal { QScrollBar::handle:horizontal {
background: #45475a; border-radius: 5px; min-width: 30px; background: #c0c0c0; border-radius: 5px; min-width: 30px;
} }
QScrollBar::handle:horizontal:hover { background: #585b70; } QScrollBar::handle:horizontal:hover { background: #a0a0a0; }
""") """)
# ── Drag & Drop ── # ── Drag & Drop ──
@@ -268,19 +263,19 @@ class MainWindow(QMainWindow):
rtb.setOrientation(Qt.Orientation.Vertical) rtb.setOrientation(Qt.Orientation.Vertical)
rtb.setStyleSheet(""" rtb.setStyleSheet("""
QToolBar { QToolBar {
background: #181825; border-left: 1px solid #313244; background: #f2f2f2; border-left: 1px solid #d0d0d0;
padding: 6px 4px; spacing: 1px; padding: 6px 4px; spacing: 1px;
} }
QToolBar QToolButton { QToolBar QToolButton {
color: #a6adc8; padding: 7px 4px; border-radius: 6px; color: #555; padding: 7px 4px; border-radius: 6px;
font-size: 11px; min-width: 64px; font-size: 11px; min-width: 64px;
border: 1px solid transparent; border: 1px solid transparent;
} }
QToolBar QToolButton:hover { QToolBar QToolButton:hover {
background: #313244; color: #cdd6f4; background: #d8f0f8; color: #006fa6;
border: 1px solid #45475a; border: 1px solid #00b4d8;
} }
QToolBar QToolButton:pressed { background: #45475a; } QToolBar QToolButton:pressed { background: #b8e6f0; }
""") """)
self.addToolBar(Qt.ToolBarArea.RightToolBarArea, rtb) self.addToolBar(Qt.ToolBarArea.RightToolBarArea, rtb)
@@ -319,9 +314,9 @@ class MainWindow(QMainWindow):
lbl = QLabel(text) lbl = QLabel(text)
lbl.setAlignment(Qt.AlignmentFlag.AlignCenter) lbl.setAlignment(Qt.AlignmentFlag.AlignCenter)
lbl.setStyleSheet(""" lbl.setStyleSheet("""
color: #89b4fa; font-size: 9px; font-weight: bold; color: #00b4d8; font-size: 9px; font-weight: bold;
letter-spacing: 2px; padding: 8px 0 3px 0; letter-spacing: 2px; padding: 8px 0 3px 0;
border-bottom: 1px solid #313244; margin: 0 4px; border-bottom: 1px solid #d0d0d0; margin: 0 4px;
""") """)
return lbl return lbl
@@ -710,7 +705,7 @@ class MainWindow(QMainWindow):
reader = PdfReader(self._current_file) reader = PdfReader(self._current_file)
page = reader.pages[self._viewer.current_page] page = reader.pages[self._viewer.current_page]
w, h = get_page_size(page) w, h = get_page_size(page)
dlg = CropDialog( self._crop_dlg = CropDialog(
page_width_pt=w, page_height_pt=h, page_width_pt=w, page_height_pt=h,
total_pages=len(reader.pages), total_pages=len(reader.pages),
current_page=self._viewer.current_page, current_page=self._viewer.current_page,
@@ -718,9 +713,9 @@ class MainWindow(QMainWindow):
parent=self parent=self
) )
def on_accepted(): def on_crop_accepted():
self._show_progress() self._show_progress()
settings = dlg.get_settings() settings = self._crop_dlg.get_settings()
output = self._make_temp() output = self._make_temp()
try: try:
crop_pages(self._current_file, output, **settings) crop_pages(self._current_file, output, **settings)
@@ -728,9 +723,11 @@ class MainWindow(QMainWindow):
except Exception as e: except Exception as e:
self._hide_progress() self._hide_progress()
QMessageBox.critical(self, "Erreur", str(e)) QMessageBox.critical(self, "Erreur", str(e))
self._crop_dlg = None
dlg.accepted.connect(on_accepted) self._crop_dlg.accepted.connect(on_crop_accepted)
dlg.show() self._crop_dlg.rejected.connect(lambda: setattr(self, '_crop_dlg', None))
self._crop_dlg.show()
def _do_print(self): def _do_print(self):
if not self._require_file(): if not self._require_file():

View File

@@ -29,28 +29,28 @@ class PagePanel(QWidget):
self._list.setSpacing(4) self._list.setSpacing(4)
self._list.setStyleSheet(""" self._list.setStyleSheet("""
QListWidget { QListWidget {
background: #181825; background: #e0e0e0;
border: none; border: none;
border-right: 1px solid #313244; border-right: 1px solid #d0d0d0;
padding: 4px; padding: 4px;
} }
QListWidget::item { QListWidget::item {
background: #1e1e2e; background: #ffffff;
border: 1px solid #313244; border: 1px solid #d0d0d0;
border-radius: 6px; border-radius: 6px;
padding: 4px; padding: 4px;
color: #a6adc8; color: #555;
font-size: 10px; font-size: 10px;
margin: 2px 0; margin: 2px 0;
} }
QListWidget::item:hover { QListWidget::item:hover {
background: #313244; background: #e0f4ff;
border-color: #45475a; border-color: #00b4d8;
} }
QListWidget::item:selected { QListWidget::item:selected {
background: #313244; background: #d8f0f8;
border: 1px solid #89b4fa; border: 2px solid #00b4d8;
color: #cdd6f4; color: #006fa6;
} }
""") """)
@@ -101,9 +101,9 @@ class PagePanel(QWidget):
menu = QMenu(self) menu = QMenu(self)
menu.setStyleSheet(""" menu.setStyleSheet("""
QMenu { background: #1e1e2e; color: #cdd6f4; border: 1px solid #45475a; border-radius: 8px; padding: 4px; } QMenu { background: #fff; color: #2d2d2d; border: 1px solid #d0d0d0; border-radius: 8px; padding: 4px; }
QMenu::item { padding: 6px 20px; border-radius: 4px; } QMenu::item { padding: 6px 20px; border-radius: 4px; }
QMenu::item:selected { background: #45475a; } QMenu::item:selected { background: #e0f4ff; color: #006fa6; }
""") """)
act_insert = menu.addAction("Inserer une page blanche apres") act_insert = menu.addAction("Inserer une page blanche apres")

View File

@@ -163,12 +163,12 @@ class PdfViewer(QWidget):
self._scroll = QScrollArea() self._scroll = QScrollArea()
self._scroll.setWidgetResizable(True) self._scroll.setWidgetResizable(True)
self._scroll.setAlignment(Qt.AlignmentFlag.AlignCenter) self._scroll.setAlignment(Qt.AlignmentFlag.AlignCenter)
self._scroll.setStyleSheet("QScrollArea { background: #11111b; border: none; }") self._scroll.setStyleSheet("QScrollArea { background: #d0d0d0; border: none; }")
self._image_label = SelectableImageLabel() self._image_label = SelectableImageLabel()
self._image_label.setAlignment(Qt.AlignmentFlag.AlignCenter) self._image_label.setAlignment(Qt.AlignmentFlag.AlignCenter)
self._image_label.setSizePolicy(QSizePolicy.Policy.Ignored, QSizePolicy.Policy.Ignored) self._image_label.setSizePolicy(QSizePolicy.Policy.Ignored, QSizePolicy.Policy.Ignored)
self._image_label.setStyleSheet("background: #11111b;") self._image_label.setStyleSheet("background: #d0d0d0;")
self._image_label.selection_changed.connect(self.selection_changed.emit) self._image_label.selection_changed.connect(self.selection_changed.emit)
self._image_label.selection_done.connect(self.selection_done.emit) self._image_label.selection_done.connect(self.selection_done.emit)
self._scroll.setWidget(self._image_label) self._scroll.setWidget(self._image_label)

View File

@@ -13,7 +13,7 @@ class SplashScreen(QWidget):
self.setWindowFlags(Qt.WindowType.FramelessWindowHint | Qt.WindowType.WindowStaysOnTopHint) self.setWindowFlags(Qt.WindowType.FramelessWindowHint | Qt.WindowType.WindowStaysOnTopHint)
self.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground, False) self.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground, False)
self.setFixedSize(500, 400) self.setFixedSize(500, 400)
self.setStyleSheet("background-color: #0f172a;") self.setStyleSheet("background-color: #f5f5f5; border: 1px solid #d0d0d0;")
layout = QVBoxLayout(self) layout = QVBoxLayout(self)
layout.setContentsMargins(40, 30, 40, 30) layout.setContentsMargins(40, 30, 40, 30)
@@ -36,14 +36,14 @@ class SplashScreen(QWidget):
title = QLabel("COPYDEV IMPOSING TOOL") title = QLabel("COPYDEV IMPOSING TOOL")
title.setAlignment(Qt.AlignmentFlag.AlignCenter) title.setAlignment(Qt.AlignmentFlag.AlignCenter)
title.setFont(QFont("Segoe UI", 18, QFont.Weight.Bold)) title.setFont(QFont("Segoe UI", 18, QFont.Weight.Bold))
title.setStyleSheet("color: white;") title.setStyleSheet("color: #2d2d2d;")
layout.addWidget(title) layout.addWidget(title)
# Sous-titre # Sous-titre
subtitle = QLabel("Outil professionnel d'imposition PDF") subtitle = QLabel("Outil professionnel d'imposition PDF")
subtitle.setAlignment(Qt.AlignmentFlag.AlignCenter) subtitle.setAlignment(Qt.AlignmentFlag.AlignCenter)
subtitle.setFont(QFont("Segoe UI", 11)) subtitle.setFont(QFont("Segoe UI", 11))
subtitle.setStyleSheet("color: #94a3b8;") subtitle.setStyleSheet("color: #666;")
layout.addWidget(subtitle) layout.addWidget(subtitle)
layout.addSpacing(20) layout.addSpacing(20)
@@ -52,7 +52,7 @@ class SplashScreen(QWidget):
self._status = QLabel("Demarrage...") self._status = QLabel("Demarrage...")
self._status.setAlignment(Qt.AlignmentFlag.AlignCenter) self._status.setAlignment(Qt.AlignmentFlag.AlignCenter)
self._status.setFont(QFont("Segoe UI", 9)) self._status.setFont(QFont("Segoe UI", 9))
self._status.setStyleSheet("color: #64748b;") self._status.setStyleSheet("color: #888;")
layout.addWidget(self._status) layout.addWidget(self._status)
layout.addStretch() layout.addStretch()
@@ -64,14 +64,14 @@ class SplashScreen(QWidget):
) )
contact.setAlignment(Qt.AlignmentFlag.AlignCenter) contact.setAlignment(Qt.AlignmentFlag.AlignCenter)
contact.setFont(QFont("Segoe UI", 8)) contact.setFont(QFont("Segoe UI", 8))
contact.setStyleSheet("color: #475569;") contact.setStyleSheet("color: #999;")
layout.addWidget(contact) layout.addWidget(contact)
# Copyright # Copyright
copy_label = QLabel("2026 CopyDev - Tous droits reserves") copy_label = QLabel("2026 CopyDev - Tous droits reserves")
copy_label.setAlignment(Qt.AlignmentFlag.AlignCenter) copy_label.setAlignment(Qt.AlignmentFlag.AlignCenter)
copy_label.setFont(QFont("Segoe UI", 7)) copy_label.setFont(QFont("Segoe UI", 7))
copy_label.setStyleSheet("color: #334155;") copy_label.setStyleSheet("color: #bbb;")
layout.addWidget(copy_label) layout.addWidget(copy_label)
# Centrer sur l'ecran # Centrer sur l'ecran

View File

@@ -14,7 +14,7 @@ REPO = "jules/copydev-imposing-tool"
BRANCH = "master" BRANCH = "master"
# Version actuelle (incrementee a chaque release) # Version actuelle (incrementee a chaque release)
VERSION = "2.4.0" VERSION = "2.5.0"
def get_remote_version(): def get_remote_version():

View File

@@ -1 +1 @@
2.4.0 2.5.0