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