Files
copydev-imposing-tool/app/splash.py
Jules e94158aae8 V2.5.1 — Dialogue licence custom + fix recadrage + style
- Dialogue de licence custom (remplace QInputDialog moche)
  - Logo CopyDev, champ stylise, bouton Activer cyan
  - Messages erreur/succes en dialogues custom colores
- Fix recadrage : reference au dialogue preservee avant destruction
- Splash screen sans bordure carree
- Style coherent gris/cyan sur tous les dialogues

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 14:49:29 +01:00

94 lines
3.2 KiB
Python

"""Splash screen CopyDev au demarrage."""
import os
import sys
from PyQt6.QtWidgets import QWidget, QVBoxLayout, QLabel, QApplication
from PyQt6.QtGui import QPixmap, QFont, QColor, QPainter
from PyQt6.QtCore import Qt, QTimer
class SplashScreen(QWidget):
def __init__(self, parent=None):
super().__init__(parent)
self.setWindowFlags(Qt.WindowType.FramelessWindowHint | Qt.WindowType.WindowStaysOnTopHint)
self.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground, False)
self.setFixedSize(500, 400)
self.setStyleSheet("""
QWidget {
background-color: #f5f5f5;
border-radius: 16px;
}
""")
layout = QVBoxLayout(self)
layout.setContentsMargins(40, 30, 40, 30)
# Logo
logo_label = QLabel()
base = sys._MEIPASS if getattr(sys, 'frozen', False) else os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
logo_path = os.path.join(base, "resources", "logo.png")
if os.path.exists(logo_path):
pixmap = QPixmap(logo_path).scaled(140, 140,
Qt.AspectRatioMode.KeepAspectRatio,
Qt.TransformationMode.SmoothTransformation)
logo_label.setPixmap(pixmap)
logo_label.setAlignment(Qt.AlignmentFlag.AlignCenter)
layout.addWidget(logo_label)
layout.addSpacing(10)
# Nom app
title = QLabel("COPYDEV IMPOSING TOOL")
title.setAlignment(Qt.AlignmentFlag.AlignCenter)
title.setFont(QFont("Segoe UI", 18, QFont.Weight.Bold))
title.setStyleSheet("color: #2d2d2d;")
layout.addWidget(title)
# Sous-titre
subtitle = QLabel("Outil professionnel d'imposition PDF")
subtitle.setAlignment(Qt.AlignmentFlag.AlignCenter)
subtitle.setFont(QFont("Segoe UI", 11))
subtitle.setStyleSheet("color: #666;")
layout.addWidget(subtitle)
layout.addSpacing(20)
# Status
self._status = QLabel("Demarrage...")
self._status.setAlignment(Qt.AlignmentFlag.AlignCenter)
self._status.setFont(QFont("Segoe UI", 9))
self._status.setStyleSheet("color: #888;")
layout.addWidget(self._status)
layout.addStretch()
# Coordonnees
contact = QLabel(
"CopyDev - Jules Dubois\n"
"contact@copydev.fr | www.copydev.fr"
)
contact.setAlignment(Qt.AlignmentFlag.AlignCenter)
contact.setFont(QFont("Segoe UI", 8))
contact.setStyleSheet("color: #999;")
layout.addWidget(contact)
# Copyright
copy_label = QLabel("2026 CopyDev - Tous droits reserves")
copy_label.setAlignment(Qt.AlignmentFlag.AlignCenter)
copy_label.setFont(QFont("Segoe UI", 7))
copy_label.setStyleSheet("color: #bbb;")
layout.addWidget(copy_label)
# Centrer sur l'ecran
screen = QApplication.primaryScreen()
if screen:
geo = screen.geometry()
self.move(
(geo.width() - self.width()) // 2,
(geo.height() - self.height()) // 2
)
def set_status(self, text):
self._status.setText(text)
QApplication.processEvents()