Fix app icon visibility on Windows and add debug logs
Some checks failed
Build Linux / Build Linux (push) Successful in 1m28s
Build Windows / Build Windows (push) Has been cancelled

This commit is contained in:
2026-01-13 19:11:31 +01:00
parent f4af5f6389
commit 48b966f9a8

View File

@@ -1,6 +1,7 @@
import sys import sys
import os import os
import platform
from PyQt6.QtWidgets import QApplication from PyQt6.QtWidgets import QApplication
from PyQt6.QtGui import QIcon from PyQt6.QtGui import QIcon
from teletext.ui import MainWindow from teletext.ui import MainWindow
@@ -16,14 +17,30 @@ def resource_path(relative_path):
return os.path.join(base_path, relative_path) return os.path.join(base_path, relative_path)
def main(): 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) app = QApplication(sys.argv)
# Set App Icon # Set App Icon
icon_path = resource_path("app_icon.png") icon_path = resource_path("app_icon.png")
print(f"DEBUG: Looking for icon at: {icon_path}")
if os.path.exists(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() window = MainWindow()
# Ensure window inherits the icon
if os.path.exists(icon_path):
window.setWindowIcon(QIcon(icon_path))
window.show() window.show()
sys.exit(app.exec()) sys.exit(app.exec())