Init projet Photostation - borne impression photo tactile PyQt6
Structure : 4 écrans (accueil, import, éditeur, impression), navigation QStackedWidget, base éditeur QGraphicsScene. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
77
src/ui/screens/home_screen.py
Normal file
77
src/ui/screens/home_screen.py
Normal file
@@ -0,0 +1,77 @@
|
||||
"""Écran d'accueil — choix du mode d'import."""
|
||||
|
||||
from PyQt6.QtWidgets import (
|
||||
QWidget, QVBoxLayout, QHBoxLayout, QPushButton, QLabel
|
||||
)
|
||||
from PyQt6.QtCore import Qt
|
||||
from PyQt6.QtGui import QFont
|
||||
|
||||
|
||||
class HomeScreen(QWidget):
|
||||
def __init__(self, main_window):
|
||||
super().__init__()
|
||||
self.main_window = main_window
|
||||
self._setup_ui()
|
||||
|
||||
def _setup_ui(self):
|
||||
layout = QVBoxLayout(self)
|
||||
layout.setAlignment(Qt.AlignmentFlag.AlignCenter)
|
||||
layout.setSpacing(40)
|
||||
|
||||
# Titre
|
||||
title = QLabel("Photostation")
|
||||
title.setFont(QFont("", 48, QFont.Weight.Bold))
|
||||
title.setAlignment(Qt.AlignmentFlag.AlignCenter)
|
||||
layout.addWidget(title)
|
||||
|
||||
subtitle = QLabel("Sélectionnez un mode d'import")
|
||||
subtitle.setFont(QFont("", 20))
|
||||
subtitle.setAlignment(Qt.AlignmentFlag.AlignCenter)
|
||||
layout.addWidget(subtitle)
|
||||
|
||||
# Boutons d'import
|
||||
buttons_layout = QHBoxLayout()
|
||||
buttons_layout.setSpacing(20)
|
||||
|
||||
modes = [
|
||||
("USB", "Clé USB", self._import_usb),
|
||||
("WiFi", "Depuis téléphone", self._import_wifi),
|
||||
("QR Code", "Scanner pour envoyer", self._import_qr),
|
||||
("Email", "Recevoir par mail", self._import_email),
|
||||
]
|
||||
|
||||
for label, desc, callback in modes:
|
||||
btn = self._create_mode_button(label, desc)
|
||||
btn.clicked.connect(callback)
|
||||
buttons_layout.addWidget(btn)
|
||||
|
||||
layout.addLayout(buttons_layout)
|
||||
|
||||
def _create_mode_button(self, label, description):
|
||||
btn = QPushButton(f"{label}\n{description}")
|
||||
btn.setFont(QFont("", 16))
|
||||
btn.setMinimumSize(200, 150)
|
||||
btn.setStyleSheet("""
|
||||
QPushButton {
|
||||
background-color: #2196F3;
|
||||
color: white;
|
||||
border-radius: 15px;
|
||||
padding: 20px;
|
||||
}
|
||||
QPushButton:pressed {
|
||||
background-color: #1976D2;
|
||||
}
|
||||
""")
|
||||
return btn
|
||||
|
||||
def _import_usb(self):
|
||||
self.main_window.show_import()
|
||||
|
||||
def _import_wifi(self):
|
||||
self.main_window.show_import()
|
||||
|
||||
def _import_qr(self):
|
||||
self.main_window.show_import()
|
||||
|
||||
def _import_email(self):
|
||||
self.main_window.show_import()
|
||||
Reference in New Issue
Block a user