diff --git a/GitUpdateChecker.exe b/GitUpdateChecker.exe index 0add629..94ea8f8 100644 Binary files a/GitUpdateChecker.exe and b/GitUpdateChecker.exe differ diff --git a/_internal/base_library.zip b/_internal/base_library.zip index 57522b5..0ddb245 100644 Binary files a/_internal/base_library.zip and b/_internal/base_library.zip differ diff --git a/_internal/icon_small.png b/_internal/icon_small.png new file mode 100644 index 0000000..da1b4c1 Binary files /dev/null and b/_internal/icon_small.png differ diff --git a/build.bat b/build.bat index 66d25c2..dbd8e88 100644 --- a/build.bat +++ b/build.bat @@ -19,13 +19,13 @@ if errorlevel 1 ( pip install pyinstaller ) -echo [*] Conversion icon.png -> icon.ico... -python -c "from PIL import Image; img = Image.open('icon.png'); img.save('icon.ico', format='ICO', sizes=[(256,256),(128,128),(64,64),(32,32),(16,16)])" +echo [*] Conversion icon.png -> icon.ico + icon_small.png (32x32)... +python -c "from PIL import Image; img = Image.open('icon.png').convert('RGBA'); img.save('icon.ico', format='ICO', sizes=[(256,256),(128,128),(64,64),(32,32),(16,16)]); thumb = img.copy(); thumb.thumbnail((32,32), Image.LANCZOS); thumb.save('icon_small.png')" echo [*] Compilation en cours... echo. -pyinstaller --onedir --noconsole --name "GitUpdateChecker" --icon=icon.ico --add-data "icon.png:." -y git_updater.py +pyinstaller --onedir --noconsole --name "GitUpdateChecker" --icon=icon.ico --add-data "icon.png:." --add-data "icon_small.png:." -y git_updater.py echo. if exist "dist\GitUpdateChecker\GitUpdateChecker.exe" ( diff --git a/git_updater.py b/git_updater.py index 4d0f5b0..bf6f221 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.5" +VERSION = "0.6.6" import subprocess import sys @@ -485,13 +485,13 @@ def do_restore(local_path): 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" + def _find_icon(filename="icon.png"): + """Cherche un fichier icône : d'abord à côté de l'exe, sinon dans _internal (bundle).""" + p = get_exe_dir() / filename if p.exists(): return p if getattr(sys, "frozen", False) and hasattr(sys, "_MEIPASS"): - p = Path(sys._MEIPASS) / "icon.png" + p = Path(sys._MEIPASS) / filename if p.exists(): return p return None @@ -558,15 +558,12 @@ class App(tk.Tk): header = ttk.Frame(self) header.pack(fill="x", padx=15, pady=(15, 5)) - # Icône dans le coin haut gauche (32x32, ratio conservé) - if self._app_icon: + # Icône dans le coin haut gauche (icon_small.png pré-générée à 32x32) + small_path = self._find_icon("icon_small.png") + if small_path: try: - 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)) + self._icon_small = tk.PhotoImage(file=str(small_path)) + tk.Label(header, image=self._icon_small, bg=bg, bd=0).pack(side="left", padx=(0, 8)) except Exception as e: log.warning(f"Icone header: {e}") diff --git a/icon_small.png b/icon_small.png new file mode 100644 index 0000000..da1b4c1 Binary files /dev/null and b/icon_small.png differ diff --git a/version.txt b/version.txt index ef5e445..05e8a45 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.6.5 +0.6.6