Skip to content

Commit

Permalink
Windows Icons broken again... fixed (hopefully)
Browse files Browse the repository at this point in the history
  • Loading branch information
christofsteel committed Oct 6, 2024
1 parent 806ee45 commit b16520c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion syng/gui.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from io import BytesIO
import sys
import logging
from logging.handlers import QueueListener
from multiprocessing import Process, Queue
Expand Down Expand Up @@ -838,11 +839,17 @@ def emit(self, record: logging.LogRecord) -> None:
def run_gui() -> None:
# initialize cache dir
os.makedirs(platformdirs.user_cache_dir("syng"), exist_ok=True)
base_dir = os.path.dirname(__file__)
if getattr(sys, "frozen", False) and hasattr(sys, "_MEIPASS"):
base_dir = getattr(sys, "_MEIPASS")

signal.signal(signal.SIGINT, signal.SIG_DFL)

app = QApplication([])
app.setWindowIcon(QIcon(":/icons/syng.ico"))
if os.name == "nt":
app.setWindowIcon(QIcon(os.path.join(base_dir, "syng.ico")))
else:
app.setWindowIcon(QIcon(":/icons/syng.ico"))
app.setApplicationName("Syng")
app.setDesktopFileName("rocks.syng.Syng")
window = SyngGui()
Expand Down

0 comments on commit b16520c

Please sign in to comment.