Skip to content

Commit

Permalink
Added temporary icon to show in the taskbar and application bar
Browse files Browse the repository at this point in the history
  • Loading branch information
jvdwetering committed Nov 13, 2023
1 parent 7039f8f commit 72ac990
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion zxlive/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,20 @@

from PySide6.QtWidgets import QApplication
from PySide6.QtCore import QCommandLineParser
from PySide6.QtGui import QIcon
import sys
from .mainwindow import MainWindow
from .common import get_data

sys.path.insert(0, '../pyzx') # So that it can find a local copy of pyzx
#sys.path.insert(0, '../pyzx') # So that it can find a local copy of pyzx

# The following hack is needed on windows in order to show the icon in the taskbar
# See https://stackoverflow.com/questions/1551605/how-to-set-applications-taskbar-icon-in-windows-7/1552105#1552105
import os
if os.name == 'nt':
import ctypes
myappid = 'quantomatic.zxlive.zxlive.1.0.0' # arbitrary string
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(myappid)


class ZXLive(QApplication):
Expand All @@ -35,6 +45,8 @@ def __init__(self) -> None:
self.setDesktopFileName('ZXLive')
self.setApplicationVersion('0.1') # TODO: read this from pyproject.toml if possible
self.main_window = MainWindow()
self.main_window.setWindowIcon(QIcon(get_data('icons/logo.png')))
self.setWindowIcon(self.main_window.windowIcon())

self.lastWindowClosed.connect(self.quit)

Expand Down
Binary file added zxlive/icons/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 72ac990

Please sign in to comment.