order adjustments

This commit is contained in:
Louis Mazin 2025-09-09 17:44:42 +02:00
parent 80492ef08c
commit 9f94357acf
7 changed files with 111 additions and 129 deletions

View File

@ -22,7 +22,7 @@ class SettingsManager:
# Hardcoded fallback settings in case files are missing
self.fallback_settings: Dict[str, Any] = {
"theme": "dark",
"lang": "en",
"lang": "fr",
"window_size": {"width": 1000, "height": 600},
"maximized": False
}

View File

@ -36,82 +36,45 @@ class ThemeManager:
def get_sheet(self) -> str:
return f"""
QWidget {{
background-color: {self.current_theme.get_color("background2")};
color: {self.current_theme.get_color("font_color")};
background-color: {self.current_theme.get_color("background_secondary_color")};
color: {self.current_theme.get_color("text_color")};
}}
#tab_bar {{
background-color: {self.current_theme.get_color("background")};
QLabel {{
color: {self.current_theme.get_color("text_color")};
font-size: 20px;
}}
QPushButton {{
background-color: {self.current_theme.get_color("interactive")};
color: {self.current_theme.get_color("font_color")};
background-color: {self.current_theme.get_color("primary_color")};
color: {self.current_theme.get_color("text_color")};
border-radius: 8px;
font-size: 16px;
padding: 10px 20px;
border: none;
}}
QPushButton:hover {{
background-color: {self.current_theme.get_color("interactive_hover")};
}}
QLabel {{
color: {self.current_theme.get_color("font_color")};
font-size: 20px;
background-color: {self.current_theme.get_color("primary_hover_color")};
}}
QProgressBar {{
border: 1px solid {self.current_theme.get_color("border")};
border: 1px solid {self.current_theme.get_color("border_color")};
border-radius: 5px;
background-color: {self.current_theme.get_color("background2")};
background-color: {self.current_theme.get_color("background_secondary_color")};
text-align: center;
color: {self.current_theme.get_color("font_color")};
color: {self.current_theme.get_color("text_color")};
}}
QProgressBar::chunk {{
background-color: {self.current_theme.get_color("interactive")};
background-color: {self.current_theme.get_color("primary_color")};
border-radius: 3px;
}}
QScrollBar:vertical {{
border: none;
background: {self.current_theme.get_color("background3")};
width: 8px;
margin: 0px;
}}
QScrollBar::handle:vertical {{
background: {self.current_theme.get_color("interactive")};
border-radius: 4px;
min-height: 20px;
}}
QScrollBar::handle:vertical:hover {{
background: {self.current_theme.get_color("interactive_hover")};
}}
QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical {{
border: none;
background: none;
height: 0px;
}}
QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {{
background: none;
}}
QSlider::groove:horizontal {{
border: 1px solid {self.current_theme.get_color("interactive")};
height: 10px;
background: transparent;
border-radius: 5px;
}}
QSlider::sub-page:horizontal {{
background: {self.current_theme.get_color("interactive")};
border-radius: 5px;
}}
QSlider::add-page:horizontal {{
background: {self.current_theme.get_color("background3")};
border-radius: 5px;
}}
QSlider::handle:horizontal {{
background: white;
border: 2px solid {self.current_theme.get_color("interactive")};
width: 14px;
margin: -4px 0;
border-radius: 7px;
QTextEdit {{
border: 1px solid {self.current_theme.get_color("border_color")};
border-radius: 8px;
padding: 10px;
font-size: 14px;
background-color: {self.current_theme.get_color("background_secondary_color")};
color: {self.current_theme.get_color("text_color")};
}}
QComboBox {{
border: 2px solid {self.current_theme.get_color("border_color")};
padding: 5px;
border-radius: 8px;
font-size: 14px;
@ -126,45 +89,70 @@ class ThemeManager:
padding: 12px 15px;
margin: 0px;
min-height: 20px;
border: 1px solid {self.current_theme.get_color("border")};
border: 1px solid {self.current_theme.get_color("border_color")};
border-radius: 8px;
}}
QComboBox QAbstractItemView::item:hover {{
background-color: {self.current_theme.get_color("background3")};
color: {self.current_theme.get_color("font_color")};
background-color: {self.current_theme.get_color("background_tertiary_color")};
color: {self.current_theme.get_color("text_color")};
}}
QComboBox QAbstractItemView::item:selected {{
color: {self.current_theme.get_color("font_color")};
color: {self.current_theme.get_color("text_color")};
}}
QTextEdit {{
border: 1px solid {self.current_theme.get_color("border")};
border-radius: 8px;
padding: 10px;
font-size: 14px;
background-color: {self.current_theme.get_color("background2")};
color: {self.current_theme.get_color("font_color")};
}}
QComboBox {{
padding: 5px;
border-radius: 8px;
font-size: 14px;
min-height: 30px;
}}
QComboBox {{
border: 2px solid {self.current_theme.get_color("border")};
}}
QComboBox::drop-down {{
border: none;
background: transparent;
}}
QComboBox::down-arrow {{
image: none;
}}
/* Optionnel: indicateur visuel au hover */
QComboBox:hover {{
border-color: {self.current_theme.get_color("interactive_hover")};
border-color: {self.current_theme.get_color("primary_hover_color")};
}}
QSlider::groove:horizontal {{
border: 1px solid {self.current_theme.get_color("primary_color")};
height: 10px;
background: transparent;
border-radius: 5px;
}}
QSlider::sub-page:horizontal {{
background: {self.current_theme.get_color("primary_color")};
border-radius: 5px;
}}
QSlider::add-page:horizontal {{
background: {self.current_theme.get_color("background_tertiary_color")};
border-radius: 5px;
}}
QSlider::handle:horizontal {{
background: white;
border: 2px solid {self.current_theme.get_color("primary_color")};
width: 14px;
margin: -4px 0;
border-radius: 7px;
}}
QScrollBar:vertical {{
border: none;
background: {self.current_theme.get_color("background_tertiary_color")};
width: 8px;
margin: 0px;
}}
QScrollBar::handle:vertical {{
background: {self.current_theme.get_color("primary_color")};
border-radius: 4px;
min-height: 20px;
}}
QScrollBar::handle:vertical:hover {{
background: {self.current_theme.get_color("primary_hover_color")};
}}
QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical {{
border: none;
background: none;
height: 0px;
}}
QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {{
background: none;
}}
#tab_bar {{
background-color: {self.current_theme.get_color("background_color")};
}}
"""

View File

@ -116,13 +116,9 @@ class UpdateManager:
# Gérer l'annulation après la fermeture du fichier
if download_cancelled:
# Attendre un peu pour s'assurer que le fichier n'est plus utilisé
QApplication.processEvents()
import time
time.sleep(0.1) # Attendre 100ms pour libérer le handle
try:
if os.path.exists(local_path):
os.remove(local_path)
os.remove(local_path, dir_fd=None)
except (OSError, PermissionError):
# Si on ne peut pas supprimer le fichier, on continue sans erreur
pass

View File

@ -1,34 +1,33 @@
{
"lang_name": "English",
"yes": "Yes",
"no": "No",
"language": "Language :",
"settings": "Settings",
"theme": "Theme :",
"dark_theme": "Dark Theme",
"light_theme": "Light Theme",
"yes": "Yes",
"no": "No",
"confirmation": "Confirmation",
"information": "Information",
"close": "Close",
"suggestion_text": "Do you have a question or an idea to improve this application? Send me a message!",
"suggestion_placeholder": "Type your message here...",
"send_suggestion": "Send",
"sending": "Sending...",
"success": "Success",
"error": "Error",
"confirmation": "Confirmation",
"suggestion_sent_success": "Your message has been sent successfully!",
"suggestion_send_error": "Error sending message. Try again later.",
"email_credentials_error": "Email credentials not or bad configured. Please set your email and password in the .env file.",
"suggestion_too_short": "The message must be at least 15 characters long.",
"update_found": "New version available: {latest_tag} \nDo you want to install the update?",
"choose_update_folder": "Choose destination folder",
"downloading_update": "Downloading update...",
"update_downloaded": "Update downloaded to {local_path}",
"update_download_error": "Error downloading update",
"downloading_update": "Downloading update...",
"update": "Update",
"footer_text": "© 2025 Louis Mazin. All rights reserved.",
"details": "Details",
"version": "Version",
"details": "Details",
"update_details": "Update Details",
"close": "Close",
"update_aborted": "Update aborted by user",
"information": "Information"
"update_aborted": "Update aborted by user"
}

View File

@ -1,34 +1,33 @@
{
"lang_name": "Français",
"yes": "Oui",
"no": "Non",
"language": "Langue :",
"settings": "Paramètres",
"theme": "Thème :",
"dark_theme": "Thème Sombre",
"light_theme": "Thème Clair",
"yes": "Oui",
"no": "Non",
"confirmation": "Confirmation",
"information": "Information",
"close": "Fermer",
"suggestion_text": "Vous avez une question ou une idée pour améliorer cette application ? Envoyez-moi un message !",
"suggestion_placeholder": "Tapez votre message ici...",
"send_suggestion": "Envoyer",
"sending": "Envoi...",
"success": "Succès",
"error": "Erreur",
"confirmation": "Confirmation",
"suggestion_sent_success": "Votre message a été envoyé avec succès !",
"suggestion_send_error": "Erreur lors de l'envoi du message. Essayez à nouveau plus tard.",
"email_credentials_error": "Identifiants de messagerie non ou mal configurés. Veuillez définir votre email et mot de passe dans le fichier .env.",
"suggestion_too_short": "Le message doit contenir au moins 15 caractères.",
"update_found": "Nouvelle version disponible : {latest_tag} \nVoulez-vous installer la mise à jour ?",
"choose_update_folder": "Choisissez le dossier de destination",
"downloading_update": "Téléchargement de la mise à jour...",
"update_downloaded": "Mise à jour téléchargée dans {local_path}",
"update_download_error": "Erreur lors du téléchargement de la mise à jour",
"downloading_update": "Téléchargement de la mise à jour...",
"update": "Mise à jour",
"footer_text": "© 2025 Louis Mazin. Tous droits réservés.",
"details": "Détails",
"version": "Version",
"details": "Détails",
"update_details": "Détails de la mise à jour",
"close": "Fermer",
"update_aborted": "Mise à jour annulée par l'utilisateur",
"information": "Information"
"update_aborted": "Mise à jour annulée par l'utilisateur"
}

View File

@ -1,16 +1,16 @@
{
"theme_name": "dark",
"colors": {
"interactive": "#0A84FF",
"interactive_hover": "#007AFF",
"border": "#3C3C3E",
"background": "#212121",
"background2": "#2C2C2E",
"background3": "#4A4A4A",
"font_color": "#D1D1D6",
"selected_icon": "#D1D1D6",
"unselected_icon": "#4A4A4A",
"selected_border_icon": "#D1D1D6",
"hover_icon": "#D1D1D6"
"background_color": "#212121",
"background_secondary_color": "#2C2C2E",
"background_tertiary_color": "#4A4A4A",
"border_color": "#3C3C3E",
"text_color": "#D1D1D6",
"primary_color": "#0A84FF",
"primary_hover_color": "#007AFF",
"icon_selected_color": "#D1D1D6",
"icon_unselected_color": "#4A4A4A",
"icon_selected_border_color": "#D1D1D6",
"icon_hover_color": "#D1D1D6"
}
}

View File

@ -1,16 +1,16 @@
{
"theme_name": "light",
"colors": {
"interactive": "#0A84FF",
"interactive_hover": "#007AFF",
"border": "#1f1f20",
"background": "#FFFFFF",
"background2": "#F5F5F5",
"background3": "#E0E0E0",
"font_color": "#000000",
"selected_icon": "#000000",
"unselected_icon": "#5D5A5A",
"selected_border_icon": "#000000",
"hover_icon": "#000000"
"background_color": "#FFFFFF",
"background_secondary_color": "#F5F5F5",
"background_tertiary_color": "#E0E0E0",
"border_color": "#1f1f20",
"text_color": "#000000",
"primary_color": "#0A84FF",
"primary_hover_color": "#007AFF",
"icon_selected_color": "#000000",
"icon_unselected_color": "#5D5A5A",
"icon_selected_border_color": "#000000",
"icon_hover_color": "#000000"
}
}