V2.4.0 — Theme moderne Catppuccin + recadrage non-modal

- Theme sombre Catppuccin Mocha sur toute l'interface :
  - Menus, toolbars, dialogues, spinbox, combo, boutons
  - Scrollbars custom, bordures arrondies, hover states
  - Panneau vignettes repensé
  - Sections outils avec titre bleu
- Recadrage : dialogue non-modal (Qt.Tool) pour pouvoir
  interagir avec le viewer pendant la selection
- Fond viewer plus sombre (#11111b)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jules
2026-03-21 14:30:17 +01:00
parent 1f8f6bb89d
commit 98049cd3cb
6 changed files with 150 additions and 33 deletions

View File

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

View File

@@ -65,19 +65,111 @@ class MainWindow(QMainWindow):
self._setup_ui()
self._setup_statusbar()
# Style global
# Style global moderne
self.setStyleSheet("""
QMainWindow { background: #1a1a2e; }
QMenuBar { background: #16213e; color: #e0e0e0; font-size: 13px; padding: 2px; }
QMenuBar::item:selected { background: #0f3460; }
QMenu { background: #16213e; color: #e0e0e0; border: 1px solid #333; }
QMenu::item:selected { background: #0f3460; }
QMenu::separator { background: #333; height: 1px; margin: 4px 10px; }
QToolBar { background: #16213e; border: none; spacing: 4px; padding: 2px; }
QToolBar QToolButton { color: #e0e0e0; padding: 4px 8px; border-radius: 3px; }
QToolBar QToolButton:hover { background: #0f3460; }
QStatusBar { background: #0f0f23; color: #888; font-size: 11px; }
QSplitter::handle { background: #333; width: 3px; }
* { font-family: 'Segoe UI', sans-serif; }
QMainWindow { background: #1e1e2e; }
QMenuBar {
background: #181825; color: #cdd6f4; font-size: 13px;
padding: 3px 0; border-bottom: 1px solid #313244;
}
QMenuBar::item { padding: 4px 12px; border-radius: 4px; margin: 1px 2px; }
QMenuBar::item:selected { background: #45475a; }
QMenu {
background: #1e1e2e; color: #cdd6f4; border: 1px solid #45475a;
border-radius: 8px; padding: 4px;
}
QMenu::item { padding: 6px 24px; border-radius: 4px; }
QMenu::item:selected { background: #45475a; }
QMenu::separator { background: #313244; height: 1px; margin: 4px 12px; }
QToolBar {
background: #181825; border: none; spacing: 2px; padding: 4px;
border-bottom: 1px solid #313244;
}
QToolBar QToolButton {
color: #bac2de; padding: 5px 10px; border-radius: 6px;
font-size: 12px; border: 1px solid transparent;
}
QToolBar QToolButton:hover {
background: #313244; border: 1px solid #45475a; color: #cdd6f4;
}
QToolBar QToolButton:pressed { background: #45475a; }
QStatusBar {
background: #11111b; color: #6c7086; font-size: 11px;
border-top: 1px solid #313244;
}
QSplitter::handle { background: #313244; width: 2px; }
QSplitter::handle:hover { background: #89b4fa; }
QDialog {
background: #1e1e2e; color: #cdd6f4;
}
QGroupBox {
color: #cdd6f4; border: 1px solid #45475a; border-radius: 8px;
margin-top: 12px; padding-top: 16px; font-weight: bold;
}
QGroupBox::title {
subcontrol-origin: margin; left: 12px; padding: 0 6px;
color: #89b4fa;
}
QLabel { color: #cdd6f4; }
QLineEdit, QSpinBox, QDoubleSpinBox, QComboBox, QTextEdit {
background: #313244; color: #cdd6f4; border: 1px solid #45475a;
border-radius: 6px; padding: 4px 8px;
}
QLineEdit:focus, QSpinBox:focus, QDoubleSpinBox:focus, QComboBox:focus, QTextEdit:focus {
border: 1px solid #89b4fa;
}
QComboBox::drop-down {
border: none; padding-right: 8px;
}
QComboBox QAbstractItemView {
background: #313244; color: #cdd6f4; border: 1px solid #45475a;
selection-background-color: #45475a;
}
QPushButton {
background: #45475a; color: #cdd6f4; border: 1px solid #585b70;
border-radius: 6px; padding: 6px 14px; font-size: 12px;
}
QPushButton:hover { background: #585b70; border-color: #89b4fa; }
QPushButton:pressed { background: #313244; }
QRadioButton, QCheckBox { color: #cdd6f4; spacing: 6px; }
QRadioButton::indicator, QCheckBox::indicator {
width: 16px; height: 16px;
}
QDialogButtonBox QPushButton {
min-width: 80px;
}
QProgressBar {
background: #11111b; border: none; height: 3px;
}
QProgressBar::chunk { background: #89b4fa; border-radius: 1px; }
QScrollBar:vertical {
background: #181825; width: 10px; border: none;
}
QScrollBar::handle:vertical {
background: #45475a; border-radius: 5px; min-height: 30px;
}
QScrollBar::handle:vertical:hover { background: #585b70; }
QScrollBar::add-line, QScrollBar::sub-line { height: 0; }
QScrollBar:horizontal {
background: #181825; height: 10px; border: none;
}
QScrollBar::handle:horizontal {
background: #45475a; border-radius: 5px; min-width: 30px;
}
QScrollBar::handle:horizontal:hover { background: #585b70; }
""")
# ── Drag & Drop ──
@@ -175,12 +267,20 @@ class MainWindow(QMainWindow):
rtb.setMovable(False)
rtb.setOrientation(Qt.Orientation.Vertical)
rtb.setStyleSheet("""
QToolBar { background: #12122a; border-left: 1px solid #333; padding: 4px 2px; spacing: 2px; }
QToolBar QToolButton {
color: #ccc; padding: 6px; border-radius: 4px;
font-size: 10px; min-width: 60px;
QToolBar {
background: #181825; border-left: 1px solid #313244;
padding: 6px 4px; spacing: 1px;
}
QToolBar QToolButton:hover { background: #0f3460; color: white; }
QToolBar QToolButton {
color: #a6adc8; padding: 7px 4px; border-radius: 6px;
font-size: 11px; min-width: 64px;
border: 1px solid transparent;
}
QToolBar QToolButton:hover {
background: #313244; color: #cdd6f4;
border: 1px solid #45475a;
}
QToolBar QToolButton:pressed { background: #45475a; }
""")
self.addToolBar(Qt.ToolBarArea.RightToolBarArea, rtb)
@@ -218,7 +318,11 @@ class MainWindow(QMainWindow):
def _make_section_label(self, text):
lbl = QLabel(text)
lbl.setAlignment(Qt.AlignmentFlag.AlignCenter)
lbl.setStyleSheet("color: #555; font-size: 9px; font-weight: bold; letter-spacing: 1px; padding: 4px 0 2px 0;")
lbl.setStyleSheet("""
color: #89b4fa; font-size: 9px; font-weight: bold;
letter-spacing: 2px; padding: 8px 0 3px 0;
border-bottom: 1px solid #313244; margin: 0 4px;
""")
return lbl
# ── UI principale ──
@@ -613,7 +717,8 @@ class MainWindow(QMainWindow):
viewer=self._viewer,
parent=self
)
if dlg.exec():
def on_accepted():
self._show_progress()
settings = dlg.get_settings()
output = self._make_temp()
@@ -624,6 +729,9 @@ class MainWindow(QMainWindow):
self._hide_progress()
QMessageBox.critical(self, "Erreur", str(e))
dlg.accepted.connect(on_accepted)
dlg.show()
def _do_print(self):
if not self._require_file():
return

View File

@@ -29,22 +29,28 @@ class PagePanel(QWidget):
self._list.setSpacing(4)
self._list.setStyleSheet("""
QListWidget {
background: #252525;
background: #181825;
border: none;
border-right: 1px solid #313244;
padding: 4px;
}
QListWidget::item {
background: #333;
border: 1px solid #444;
border-radius: 4px;
background: #1e1e2e;
border: 1px solid #313244;
border-radius: 6px;
padding: 4px;
color: #ccc;
color: #a6adc8;
font-size: 10px;
margin: 2px 0;
}
QListWidget::item:hover {
background: #313244;
border-color: #45475a;
}
QListWidget::item:selected {
background: #0066cc;
border: 1px solid #0088ff;
color: white;
background: #313244;
border: 1px solid #89b4fa;
color: #cdd6f4;
}
""")
@@ -95,8 +101,9 @@ class PagePanel(QWidget):
menu = QMenu(self)
menu.setStyleSheet("""
QMenu { background: #333; color: #eee; border: 1px solid #555; }
QMenu::item:selected { background: #0066cc; }
QMenu { background: #1e1e2e; color: #cdd6f4; border: 1px solid #45475a; border-radius: 8px; padding: 4px; }
QMenu::item { padding: 6px 20px; border-radius: 4px; }
QMenu::item:selected { background: #45475a; }
""")
act_insert = menu.addAction("Inserer une page blanche apres")

View File

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

View File

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

View File

@@ -1 +1 @@
2.3.1
2.4.0