From 48b966f9a81efd23dc4140d7d90f98f5bb02c4b6 Mon Sep 17 00:00:00 2001 From: Daniel Dybing Date: Tue, 13 Jan 2026 19:11:31 +0100 Subject: [PATCH] Fix app icon visibility on Windows and add debug logs --- src/main.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 93d3aa6..909ce74 100644 --- a/src/main.py +++ b/src/main.py @@ -1,6 +1,7 @@ import sys import os +import platform from PyQt6.QtWidgets import QApplication from PyQt6.QtGui import QIcon from teletext.ui import MainWindow @@ -16,14 +17,30 @@ def resource_path(relative_path): return os.path.join(base_path, relative_path) def main(): + # Fix for Windows Taskbar Icon + if platform.system() == 'Windows': + import ctypes + myappid = 'ddybing.teletexteditor.1.0' # arbitrary string + ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(myappid) + app = QApplication(sys.argv) # Set App Icon icon_path = resource_path("app_icon.png") + print(f"DEBUG: Looking for icon at: {icon_path}") + if os.path.exists(icon_path): - app.setWindowIcon(QIcon(icon_path)) + print("DEBUG: Icon file found.") + app_icon = QIcon(icon_path) + app.setWindowIcon(app_icon) + else: + print("DEBUG: Icon file NOT found.") window = MainWindow() + # Ensure window inherits the icon + if os.path.exists(icon_path): + window.setWindowIcon(QIcon(icon_path)) + window.show() sys.exit(app.exec())