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