Fix Linux app icon: Set DesktopFileName and add image debug logs
This commit is contained in:
16
src/main.py
16
src/main.py
@@ -3,7 +3,7 @@ import sys
|
||||
import os
|
||||
import platform
|
||||
from PyQt6.QtWidgets import QApplication
|
||||
from PyQt6.QtGui import QIcon
|
||||
from PyQt6.QtGui import QIcon, QImageReader
|
||||
from teletext.ui import MainWindow
|
||||
|
||||
def resource_path(relative_path):
|
||||
@@ -24,6 +24,13 @@ def main():
|
||||
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(myappid)
|
||||
|
||||
app = QApplication(sys.argv)
|
||||
app.setApplicationName("TeletextEditor")
|
||||
app.setOrganizationName("DanielDybing")
|
||||
app.setDesktopFileName("TeletextEditor") # Helps Linux DEs group windows
|
||||
|
||||
# Debug Image Formats
|
||||
supported_formats = [str(fmt, 'utf-8') for fmt in QImageReader.supportedImageFormats()]
|
||||
print(f"DEBUG: Supported Image Formats: {supported_formats}")
|
||||
|
||||
# Set App Icon
|
||||
icon_path = resource_path("app_icon.png")
|
||||
@@ -33,6 +40,13 @@ def main():
|
||||
print("DEBUG: Icon file found.")
|
||||
app_icon = QIcon(icon_path)
|
||||
app.setWindowIcon(app_icon)
|
||||
|
||||
# Verify icon loaded
|
||||
if app_icon.isNull():
|
||||
print("DEBUG: QIcon is null (failed to load image data)")
|
||||
else:
|
||||
print(f"DEBUG: QIcon loaded. Available sizes: {app_icon.availableSizes()}")
|
||||
|
||||
else:
|
||||
print("DEBUG: Icon file NOT found.")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user