diff --git a/GitUpdateChecker.exe b/GitUpdateChecker.exe index dd15a25..0add629 100644 Binary files a/GitUpdateChecker.exe and b/GitUpdateChecker.exe differ diff --git a/_internal/base_library.zip b/_internal/base_library.zip index d736db9..57522b5 100644 Binary files a/_internal/base_library.zip and b/_internal/base_library.zip differ diff --git a/_internal/icon.png b/_internal/icon.png new file mode 100644 index 0000000..b83e484 Binary files /dev/null and b/_internal/icon.png differ diff --git a/build.bat b/build.bat index 93e68c1..66d25c2 100644 --- a/build.bat +++ b/build.bat @@ -25,7 +25,7 @@ python -c "from PIL import Image; img = Image.open('icon.png'); img.save('icon.i echo [*] Compilation en cours... echo. -pyinstaller --onedir --noconsole --name "GitUpdateChecker" --icon=icon.ico -y git_updater.py +pyinstaller --onedir --noconsole --name "GitUpdateChecker" --icon=icon.ico --add-data "icon.png:." -y git_updater.py echo. if exist "dist\GitUpdateChecker\GitUpdateChecker.exe" ( diff --git a/git_updater.py b/git_updater.py index a88d50f..4d0f5b0 100644 --- a/git_updater.py +++ b/git_updater.py @@ -5,7 +5,7 @@ Accès lecture seule uniquement (fetch/pull/checkout, jamais de push). Tous les chemins sont relatifs à l'emplacement de l'exécutable. """ -VERSION = "0.6.4" +VERSION = "0.6.5" import subprocess import sys @@ -484,6 +484,18 @@ def do_restore(local_path): # ── Interface graphique ────────────────────────────────────────────────────── class App(tk.Tk): + @staticmethod + def _find_icon(): + """Cherche icon.png : d'abord à côté de l'exe, sinon dans _internal (bundle).""" + p = get_exe_dir() / "icon.png" + if p.exists(): + return p + if getattr(sys, "frozen", False) and hasattr(sys, "_MEIPASS"): + p = Path(sys._MEIPASS) / "icon.png" + if p.exists(): + return p + return None + def __init__(self): super().__init__() self.title(f"Git Update Checker v{VERSION}") @@ -496,12 +508,13 @@ class App(tk.Tk): # Icône de la fenêtre (barre de titre + taskbar) self._app_icon = None - icon_path = get_exe_dir() / "icon.png" - if icon_path.exists(): + icon_path = self._find_icon() + if icon_path: try: self._app_icon = tk.PhotoImage(file=str(icon_path)) self.iconphoto(True, self._app_icon) - except Exception: + except Exception as e: + log.warning(f"Icone fenetre: {e}") self._app_icon = None log.info(f"=== Demarrage Git Update Checker v{VERSION} ===") @@ -545,17 +558,17 @@ class App(tk.Tk): header = ttk.Frame(self) header.pack(fill="x", padx=15, pady=(15, 5)) - # Icône dans le coin haut gauche (redimensionnée à 32x32) + # Icône dans le coin haut gauche (32x32, ratio conservé) if self._app_icon: try: - icon_small = tk.PhotoImage(file=str(get_exe_dir() / "icon.png")).subsample( - max(1, self._app_icon.width() // 32), - max(1, self._app_icon.height() // 32), - ) - self._icon_small = icon_small # garder la référence - ttk.Label(header, image=icon_small, style="TLabel").pack(side="left", padx=(0, 8)) - except Exception: - pass + w, h = self._app_icon.width(), self._app_icon.height() + # Calculer un diviseur commun pour garder le ratio + divisor = max(1, max(w, h) // 32) + icon_small = tk.PhotoImage(file=str(self._find_icon())).subsample(divisor, divisor) + self._icon_small = icon_small + tk.Label(header, image=icon_small, bg=bg, bd=0).pack(side="left", padx=(0, 8)) + except Exception as e: + log.warning(f"Icone header: {e}") ttk.Label(header, text=f"Git Update Checker v{VERSION}", style="Title.TLabel").pack(side="left") self.status_label = ttk.Label(header, text="Verification en cours...", style="Status.TLabel") diff --git a/version.txt b/version.txt index d2b13eb..ef5e445 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.6.4 +0.6.5