generated from LouisMazin/PythonApplicationTemplate
theme and footer fix
This commit is contained in:
parent
2e3be1f3ad
commit
83a8377d59
@ -39,7 +39,6 @@ class MainWindow(QMainWindow):
|
||||
self.side_menu: TabsWidget
|
||||
self.settings_window: SettingsWindow
|
||||
self.suggestion_window: SuggestionWindow
|
||||
self.footer_label: QLabel # Ajout d'un attribut pour le footer
|
||||
|
||||
self.setMinimumSize(600, 400)
|
||||
|
||||
@ -124,9 +123,6 @@ class MainWindow(QMainWindow):
|
||||
def update_theme(self) -> None:
|
||||
self.setStyleSheet(self.theme_manager.get_sheet())
|
||||
|
||||
def update_language(self) -> None:
|
||||
self.footer_label.setText(self.language_manager.get_text("footer_text"))
|
||||
|
||||
def goto_dicom_window(self):
|
||||
"""Navigate to DICOM window when DICOMs are imported"""
|
||||
self.side_menu.switch_to_tab(1)
|
@ -6,7 +6,7 @@
|
||||
"background_tertiary_color": "#4A4A4A",
|
||||
"border_color": "#3C3C3E",
|
||||
"text_color": "#D1D1D6",
|
||||
"primary_color": "#4A4A4A",
|
||||
"primary_color": "#0A84FF",
|
||||
"primary_hover_color": "#007AFF",
|
||||
"icon_selected_color": "#D1D1D6",
|
||||
"icon_unselected_color": "#4A4A4A",
|
||||
|
@ -6,7 +6,7 @@
|
||||
"background_tertiary_color": "#E0E0E0",
|
||||
"border_color": "#1f1f20",
|
||||
"text_color": "#000000",
|
||||
"primary_color": "#5D5A5A",
|
||||
"primary_color": "#0A84FF",
|
||||
"primary_hover_color": "#007AFF",
|
||||
"icon_selected_color": "#000000",
|
||||
"icon_unselected_color": "#5D5A5A",
|
||||
|
18
main.py
18
main.py
@ -6,7 +6,6 @@ from app.ui.main_window import MainWindow
|
||||
from app.ui.windows.splash_screen import SplashScreen
|
||||
from app.core.main_manager import MainManager
|
||||
|
||||
# Variable globale pour stocker la fenêtre préchargée
|
||||
preloaded_window = None
|
||||
|
||||
def preload_application(progress_callback):
|
||||
@ -26,21 +25,15 @@ def preload_application(progress_callback):
|
||||
language_manager = main_manager.get_language_manager()
|
||||
update_manager = main_manager.get_update_manager()
|
||||
|
||||
# Étape 1: Vérification des mises à jour
|
||||
progress_callback(language_manager.get_text("checking_updates"))
|
||||
|
||||
# Vérifier s'il y a une mise à jour
|
||||
if update_manager.check_for_update():
|
||||
# Une mise à jour est en cours de téléchargement, on ferme l'app
|
||||
return False
|
||||
|
||||
# Étape 2: Initialisation de la fenêtre principale
|
||||
progress_callback(language_manager.get_text("initializing"))
|
||||
|
||||
# Créer la fenêtre principale avec tous ses composants
|
||||
preloaded_window = MainWindow()
|
||||
|
||||
# Étape 3: Finalisation
|
||||
progress_callback(language_manager.get_text("loading_complete"))
|
||||
|
||||
return True
|
||||
@ -60,42 +53,35 @@ def main() -> int:
|
||||
app.setApplicationName(settings_manager.get_config("app_name"))
|
||||
app.setWindowIcon(QIcon(paths.get_asset_path("icon")))
|
||||
|
||||
# Vérifier si l'image splash existe
|
||||
splash_image_path = paths.get_asset_path(settings_manager.get_config("splash_image"))
|
||||
use_splash = splash_image_path and paths.Path(splash_image_path).exists()
|
||||
|
||||
if use_splash:
|
||||
# Créer et afficher le splash screen avec préchargement
|
||||
splash = SplashScreen(preload_function=preload_application)
|
||||
splash.show_splash()
|
||||
|
||||
# Connecter le signal finished pour afficher la fenêtre principale préchargée
|
||||
def on_splash_finished(success):
|
||||
global preloaded_window
|
||||
if not success:
|
||||
# Le préchargement a échoué ou une mise à jour est en cours
|
||||
app.quit()
|
||||
return
|
||||
|
||||
# Afficher la fenêtre préchargée
|
||||
if preloaded_window:
|
||||
preloaded_window.show()
|
||||
else:
|
||||
# Fallback si le préchargement a échoué
|
||||
window = MainWindow()
|
||||
window.show()
|
||||
|
||||
splash.finished.connect(on_splash_finished)
|
||||
else:
|
||||
# Pas de splash screen, exécuter le préchargement directement
|
||||
|
||||
def dummy_progress(text):
|
||||
pass # Pas de callback de progression sans splash
|
||||
pass
|
||||
|
||||
success = preload_application(dummy_progress)
|
||||
if not success:
|
||||
return 0
|
||||
|
||||
# Utiliser la fenêtre préchargée ou en créer une nouvelle
|
||||
window = preloaded_window if preloaded_window else MainWindow()
|
||||
window.show()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user